From 7a4112e89c4bd80ab21064d1515a52fd6c561c43 Mon Sep 17 00:00:00 2001 From: Deve Date: Wed, 12 Aug 2015 18:37:31 +0200 Subject: [PATCH] Fixed compiler warning. Based on fread specification, it returns number of elements which has been read. Here is declared one element with size of whole file (len), so returned value should be always equal to 1. --- src/scriptengine/script_engine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scriptengine/script_engine.cpp b/src/scriptengine/script_engine.cpp index aae89ce57..3db73c2b8 100644 --- a/src/scriptengine/script_engine.cpp +++ b/src/scriptengine/script_engine.cpp @@ -107,7 +107,7 @@ namespace Scripting script.resize(len); int c = fread(&script[0], len, 1, f); fclose(f); - if (c == NULL) + if (c != 1) { Log::error("Scripting", "Failed to load script file."); return "";