Commit dd9c9ffc authored by Daniel Salzman's avatar Daniel Salzman
Browse files

internal/getline: set correct output buffer length if reallocated

parent f7217860
......@@ -49,11 +49,11 @@ ssize_t knot_getline(char **lineptr, size_t *n, FILE *stream)
return -1;
}
*lineptr = tmp;
*n = length + 1;
}
memcpy(*lineptr, buffer, length);
(*lineptr)[length] = '\0';
*n = length;
return length;
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment