This commit is contained in:
Gustav Louw 2018-04-03 16:17:27 -07:00
parent 6c115010e5
commit eb898b4c22

2
test.c
View File

@ -36,7 +36,7 @@ static char* readln(FILE* const file)
int ch = EOF; int ch = EOF;
int reads = 0; int reads = 0;
int size = 128; int size = 128;
char* line = ((char*) malloc((size) * sizeof(char))); char* line = (char*) malloc((size) * sizeof(char));
while((ch = getc(file)) != '\n' && ch != EOF) while((ch = getc(file)) != '\n' && ch != EOF)
{ {
line[reads++] = ch; line[reads++] = ch;