diff options
Diffstat (limited to 'tools/skycpt/TextFile.cpp')
-rw-r--r-- | tools/skycpt/TextFile.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/skycpt/TextFile.cpp b/tools/skycpt/TextFile.cpp index 92d747f955..ee64d22f5f 100644 --- a/tools/skycpt/TextFile.cpp +++ b/tools/skycpt/TextFile.cpp @@ -28,13 +28,14 @@ TextFile::TextFile(const char *name) { FILE *inf = fopen(name, "r"); + _lines = NULL; if (!inf) { printf("Unable to open file %s\n", name); getchar(); + } else { + read(inf); + fclose(inf); } - _lines = NULL; - read(inf); - fclose(inf); } uint32 crop(char *line) { |