use agetline instead of agets

also use agetline where fgets with a static buffer was used previously.

Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
This commit is contained in:
Hiltjo Posthuma
2014-06-01 15:04:32 +02:00
committed by sin
parent eac0f658cf
commit fab4b384e7
9 changed files with 35 additions and 27 deletions

2
nl.c
View File

@@ -68,7 +68,7 @@ nl(FILE *fp)
long n = 0;
size_t size = 0;
while(afgets(&buf, &size, fp)) {
while(agetline(&buf, &size, fp) != -1) {
if((mode == 'a')
|| (mode == 'p'
&& !regexec(&preg, buf, 0, NULL, 0))