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
tr.c
View File

@@ -160,7 +160,7 @@ main(int argc, char *argv[])
mapfunc = maptoset;
}
while(afgets(&buf, &size, stdin))
while(agetline(&buf, &size, stdin) != -1)
mapfunc(mappings, buf);
free(buf);
if(ferror(stdin))