This commit is contained in:
Steven G. Johnson
2020-03-29 09:35:32 -04:00
parent f645f2a700
commit 243875b456
2 changed files with 11 additions and 11 deletions

View File

@@ -48,10 +48,10 @@ size_t encode(char *dest, const char *buf)
/* simplistic, portable replacement for getline, sufficient for our tests */
size_t simple_getline(char buf[8192], FILE *f) {
size_t i = 0;
while (i < 1023) {
while (i < 8191) {
int c = getc(f);
if (c == EOF || c == '\n') break;
buf[i++] = (char) c;
buf[i++] = (char) ((uint8_t) c);
}
buf[i] = 0;
return i;