If line is longer then size of given buffer and buffer is not allocated by
the config parser itself, then discard rest of line.
Signed-off-by: Natanael Copa <natanael.copa@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
parsr->data = realloc(parsr->data,
parsr->data_len + parsr->line_len);
parsr->line = parsr->data + parsr->data_len;
+ } else {
+ /* discard rest of line if not enough space in buffer */
+ int c;
+ do {
+ c = fgetc(parsr->fp);
+ } while (c != EOF && c != '\n');
+ break;
}
}
return pos;