From 67623f003b083f6887f24223157f19c5fc19070c Mon Sep 17 00:00:00 2001 From: "timeless@mozdev.org" Date: Tue, 8 Feb 2011 09:43:18 +0100 Subject: [PATCH] Bug 615842 - comparison between signed and unsigned integer expressions in ReadStrings. r=rstrong a=mossop --- toolkit/mozapps/readstrings/readstrings.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/toolkit/mozapps/readstrings/readstrings.cpp b/toolkit/mozapps/readstrings/readstrings.cpp index e4e09c3fffc9..04421913da97 100644 --- a/toolkit/mozapps/readstrings/readstrings.cpp +++ b/toolkit/mozapps/readstrings/readstrings.cpp @@ -167,10 +167,11 @@ ReadStrings(const NS_tchar *path, if (fseek(fp, 0, SEEK_END) != 0) return READ_ERROR; - long flen = ftell(fp); - if (flen == 0) + long len = ftell(fp); + if (len <= 0) return READ_ERROR; + size_t flen = size_t(len); char *fileContents = new char[flen + 1]; if (!fileContents) return MEM_ERROR;