From 762692e0ce2359c8a66bad8cd91357d1f85e0e4b Mon Sep 17 00:00:00 2001 From: Aaron Gutierrez Date: Sat, 28 Nov 2020 10:29:03 -0600 Subject: [PATCH] faster printing --- Makefile | 2 +- annotate.c | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 8ab585a..c50efcf 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -CFLAGS=--std=c99 -O2 -Wall -Wextra -Werror -pedantic +CFLAGS=--std=c18 -O2 -Wall -Wextra -Werror -pedantic annotate: annotate.o diff --git a/annotate.c b/annotate.c index f70601c..9eab74d 100644 --- a/annotate.c +++ b/annotate.c @@ -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); } } }