[BUG] halog: correctly handle truncated last line

If last line is truncated (eg: truncated file), then halog would loop on
it forever.
This commit is contained in:
Willy Tarreau 2011-07-09 14:28:01 +02:00
parent b3eb221e78
commit 812e7a73b2
2 changed files with 2 additions and 0 deletions

View File

@ -155,6 +155,7 @@ const char *fgets2(FILE *stream)
return NULL;
*end = '\0';
end = line; /* ensure we stop next time */
return line;
}

View File

@ -130,6 +130,7 @@ const char *fgets2(FILE *stream)
return NULL;
*end = '\0';
end = line; /* ensure we stop next time */
return line;
}