fgets into buf directly, rather than the stack

This commit is contained in:
Daniel Kahn Gillmor 2014-03-21 14:18:36 -04:00
parent cf46f5d84b
commit e3c28f8a86
1 changed files with 1 additions and 1 deletions

View File

@ -281,7 +281,7 @@ psl_ctx_t *psl_load_file(const char *fname)
psl->suffix_exceptions = _vector_alloc(64, _suffix_compare);
if ((fp = fopen(fname, "r"))) {
while ((linep = fgets(&buf, sizeof(buf), fp))) {
while ((linep = fgets(buf, sizeof(buf), fp))) {
while (isspace(*linep)) linep++; // ignore leading whitespace
if (!*linep) continue; // skip empty lines