Преглед на файлове

fix confstr return value

per the specification, the terminating null byte is counted.
Timo Teräs преди 11 години
родител
ревизия
0a8d98285f
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      src/conf/confstr.c

+ 1 - 1
src/conf/confstr.c

@@ -13,5 +13,5 @@ size_t confstr(int name, char *buf, size_t len)
 	}
 	// snprintf is overkill but avoid wasting code size to implement
 	// this completely useless function and its truncation semantics
-	return snprintf(buf, len, "%s", s);
+	return snprintf(buf, len, "%s", s) + 1;
 }