Steven G. Johnson
5 years ago
3 changed files with 17 additions and 5 deletions
@ -0,0 +1,11 @@ |
|||||
|
/* simplistic, portable replacement for getline, sufficient for our tests */ |
||||
|
static size_t simple_getline(char buf[8192], FILE *f) { |
||||
|
size_t i = 0; |
||||
|
while (i < 1023) { |
||||
|
int c = getc(f); |
||||
|
if (c == EOF || c == '\n') break; |
||||
|
buf[i++] = (char) c; |
||||
|
} |
||||
|
buf[i] = 0; |
||||
|
return i; |
||||
|
} |
Loading…
Reference in new issue