faster printing
This commit is contained in:
2
Makefile
2
Makefile
@@ -1,4 +1,4 @@
|
||||
CFLAGS=--std=c99 -O2 -Wall -Wextra -Werror -pedantic
|
||||
CFLAGS=--std=c18 -O2 -Wall -Wextra -Werror -pedantic
|
||||
|
||||
annotate: annotate.o
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user