Fix reading configuration files that do not end with a newline. Again.
This commit is contained in:
parent
26b8cf8680
commit
4766359e14
3 changed files with 6 additions and 2 deletions
|
@ -224,7 +224,7 @@ static char *readline(FILE * fp, char *buf, size_t buflen) {
|
|||
newline = strchr(p, '\n');
|
||||
|
||||
if(!newline)
|
||||
return NULL;
|
||||
return buf;
|
||||
|
||||
*newline = '\0'; /* kill newline */
|
||||
if(newline > p && newline[-1] == '\r') /* and carriage return if necessary */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue