Bug 928434 - Fix the invalid format string in nsMemoryImpl::IsLowMemoryPlatform; r=bsmedgerg
authorEhsan Akhgari <ehsan@mozilla.com>
Fri, 18 Oct 2013 20:34:57 -0400
changeset 165248 46960d4e61c82c36199c7c833cd1d3a17b65979c
parent 165247 f048fcdc03e7a096a2dfaf3f805354814b2553d2
child 165249 16cd08c4447ce95d51dc6813410f031119c75f74
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedgerg
bugs928434
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 928434 - Fix the invalid format string in nsMemoryImpl::IsLowMemoryPlatform; r=bsmedgerg
xpcom/base/nsMemoryImpl.cpp
--- a/xpcom/base/nsMemoryImpl.cpp
+++ b/xpcom/base/nsMemoryImpl.cpp
@@ -69,17 +69,17 @@ nsMemoryImpl::IsLowMemoryPlatform(bool *
         *result = false;
 
         // check if MemTotal from /proc/meminfo is less than LOW_MEMORY_THRESHOLD_KB
         FILE* fd = fopen("/proc/meminfo", "r");
         if (!fd) {
             return NS_OK;
         }
         uint64_t mem = 0;
-        int rv = fscanf(fd, "MemTotal: %lu kB", &mem);
+        int rv = fscanf(fd, "MemTotal: %llu kB", &mem);
         if (fclose(fd)) {
             return NS_OK;
         }
         if (rv != 1) {
             return NS_OK;
         }
         sLowMemory = (mem < LOW_MEMORY_THRESHOLD_KB) ? 1 : 0;
     }