diff --git a/src/hackertyper.c b/src/hackertyper.c index e4dd2ea..9f01b6d 100644 --- a/src/hackertyper.c +++ b/src/hackertyper.c @@ -31,7 +31,7 @@ int main(int argc, char *argv[]) { while (!feof(command_output_fptr)) { getchar(); - for (unsigned int i = 0; i < CHARS_TO_WRITE; i++) { + for (unsigned int i = 0; i < CHARS_TO_WRITE && !feof(command_output_fptr); i++) { current_char = fgetc(command_output_fptr); printf("%c", current_char); }