faster printing

This commit is contained in:
Aaron Gutierrez
2020-11-28 10:29:03 -06:00
parent 4c775a43fa
commit 762692e0ce
2 changed files with 2 additions and 8 deletions

View File

@@ -1,4 +1,4 @@
CFLAGS=--std=c99 -O2 -Wall -Wextra -Werror -pedantic
CFLAGS=--std=c18 -O2 -Wall -Wextra -Werror -pedantic
annotate: annotate.o

View File

@@ -45,15 +45,9 @@ int main() {
output_time = false;
}
fputc(buffer[i], stdout);
if (buffer[i] == '\n') {
printf("\n");
if (fflush(stdout) == EOF) {
perror("Unable to flush stdout");
exit(2);
}
output_time = true;
} else {
fputc(buffer[i], stdout);
}
}
}