Preserve one character space for a trailing '\0'.

Found by:	Ivan Klymenko via cppcheck
Discussed with: ae
MFC after:	1 week
This commit is contained in:
pluknet 2014-02-14 20:54:03 +00:00
parent a860c39644
commit 5d77eeed31

View File

@ -210,7 +210,7 @@ res_find(int *line, int *startln,
if (strncmp(cp, "hint.", 5) != 0)
hit = 0;
else
n = sscanf(cp, "hint.%32[^.].%d.%32[^=]=%128s",
n = sscanf(cp, "hint.%32[^.].%d.%32[^=]=%127s",
r_name, &r_unit, r_resname, r_value);
if (hit && n != 4) {
printf("CONFIG: invalid hint '%s'\n", cp);