From b7d5a7db7508dba1e1e5f527accf0dadc84efb21 Mon Sep 17 00:00:00 2001 From: Arisotura Date: Mon, 3 May 2021 17:02:38 +0200 Subject: don't attempt to parse lines that failed to fetch --- src/ARCodeFile.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ARCodeFile.cpp') diff --git a/src/ARCodeFile.cpp b/src/ARCodeFile.cpp index 2510b6e..e7780b7 100644 --- a/src/ARCodeFile.cpp +++ b/src/ARCodeFile.cpp @@ -60,8 +60,8 @@ bool ARCodeFile::Load() char linebuf[1024]; while (!feof(f)) { - if (fgets(linebuf, 1024, f) == NULL) - printf("Error reading string from file!"); + if (fgets(linebuf, 1024, f) == nullptr) + break; linebuf[1023] = '\0'; -- cgit v1.2.3