aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/hello_world_file.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/hello_world_file.cpp b/tests/hello_world_file.cpp
index 71fb953b..97ea395e 100644
--- a/tests/hello_world_file.cpp
+++ b/tests/hello_world_file.cpp
@@ -1,6 +1,10 @@
#include <stdio.h>
int main() {
FILE *file = fopen("tests/hello_world_file.txt", "rb");
+ if (!file) {
+ printf("cannot open file\n");
+ return 1;
+ }
while (!feof(file)) {
char c = fgetc(file);
if (c != EOF) {