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 166200 46960d4e61c82c36199c7c833cd1d3a17b65979c
parent 166199 f048fcdc03e7a096a2dfaf3f805354814b2553d2
child 166201 16cd08c4447ce95d51dc6813410f031119c75f74
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [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;
     }