From b89b932f1570c1dde2406ec8184a20e649db042f Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 16 Mar 2007 22:38:24 +0000 Subject: [PATCH] fixed a bug where ReadFileLine could return true when no data was read --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40644 --- core/smn_filesystem.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/smn_filesystem.cpp b/core/smn_filesystem.cpp index 5c6c9f6e..9cad4d6c 100644 --- a/core/smn_filesystem.cpp +++ b/core/smn_filesystem.cpp @@ -194,7 +194,10 @@ static cell_t sm_ReadFileLine(IPluginContext *pContext, const cell_t *params) return 0; } - fgets(buf, params[3], pFile); + if (fgets(buf, params[3], pFile) == NULL) + { + return 0; + } return 1; }