Add readline tests

This commit is contained in:
Drew DeVault 2016-06-19 12:48:20 -04:00
parent 8758a2bd04
commit 689935ed39
6 changed files with 86 additions and 14 deletions

View file

@ -10,7 +10,7 @@ char *read_line(FILE *file) {
return NULL;
}
while (1) {
int c = getc(file);
int c = fgetc(file);
if (c == '\n' && lastChar == '\\'){
--length; // Ignore last character.
lastChar = '\0';
@ -51,7 +51,7 @@ char *read_line_buffer(FILE *file, char *string, size_t string_len) {
return NULL;
}
while (1) {
int c = getc(file);
int c = fgetc(file);
if (c == EOF || c == '\n' || c == '\0') {
break;
}