From d17d9715a23618871b5b86649d4fe118ce0e64c1 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 e4e09c3fffc..04421913da9 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;