summaryrefslogtreecommitdiffstats
path: root/Source/cmHexFileConverter.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmHexFileConverter.cxx')
-rw-r--r--Source/cmHexFileConverter.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/cmHexFileConverter.cxx b/Source/cmHexFileConverter.cxx
index 91565b4..2ff7945 100644
--- a/Source/cmHexFileConverter.cxx
+++ b/Source/cmHexFileConverter.cxx
@@ -172,8 +172,10 @@ cmHexFileConverter::FileType cmHexFileConverter::DetermineFileType(
return Binary;
}
- buf[0] = 0;
- (void) fgets(buf, 1024, inFile);
+ if(!fgets(buf, 1024, inFile))
+ {
+ buf[0] = 0;
+ }
fclose(inFile);
FileType type = Binary;
unsigned int minLineLength = 0;