From 1d6094901f447e35528b2f7f4be822c58e467b83 Mon Sep 17 00:00:00 2001 From: Mathew Sutcliffe Date: Tue, 18 Nov 2014 01:19:51 +0000 Subject: [PATCH] One more cppcheck warning. --- src/XPMPMultiplayerCSL.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/XPMPMultiplayerCSL.cpp b/src/XPMPMultiplayerCSL.cpp index f2502951d..d7f4d9097 100644 --- a/src/XPMPMultiplayerCSL.cpp +++ b/src/XPMPMultiplayerCSL.cpp @@ -172,8 +172,6 @@ bool DoPackageSub(std::string& ioPath) char * fgets_multiplatform(char * s, int n, FILE * file) { char * p = s; - int c; - int c1; // Save one slot for the null. If we do not have enough memory // to do this, bail. @@ -183,6 +181,7 @@ char * fgets_multiplatform(char * s, int n, FILE * file) // Only bother to read if we have enough space in the char buf. if (n) { + int c; do { c = getc(file); @@ -210,12 +209,12 @@ char * fgets_multiplatform(char * s, int n, FILE * file) // just the first. if (c == '\r') { - c1 = getc(file); + int c1 = getc(file); if (c1 != '\n') ungetc(c1, file); } if (c == '\n') { - c1 = getc(file); + int c1 = getc(file); if (c1 != '\r') ungetc(c1, file); } }