]> git.puffer.fish Git - mirror/frr.git/commitdiff
[lib] add mising UL qualifier to numerical constant
authorPaul Jakma <paul.jakma@sun.com>
Tue, 8 Jan 2008 13:50:11 +0000 (13:50 +0000)
committerPaul Jakma <paul.jakma@sun.com>
Tue, 8 Jan 2008 13:50:11 +0000 (13:50 +0000)
2008-01-08 Pavol Rusnak <prusnak@suse.cz>

* memory.c: (mtype_memstr) Fix accidental shift past width of type,
  constant should have been forced to UL, rather than being left to
  default to int.

lib/ChangeLog
lib/memory.c

index bd66f071c3083c1e6f50989ff7a4055a30b41fa5..bbbdfab01c1ab3c9b77a7607776a2d78dbbcaaff 100644 (file)
@@ -1,3 +1,9 @@
+2008-01-08 Pavol Rusnak <prusnak@suse.cz>
+
+       * memory.c: (mtype_memstr) Fix accidental shift past width of type,
+         constant should have been forced to UL, rather than being left to
+         default to int.
+
 2007-11-12 Denis Ovsienko
 
        * linklist.c: (listnode_add_after) Don't forget to increment list
index eb670722b19fc4ae4cf1ddd31bbf0ab6d0547593..9ed5e100aa18134c0c27934e8ff7cc4e71082865 100644 (file)
@@ -501,7 +501,7 @@ mtype_memstr (char *buf, size_t len, unsigned long bytes)
        * Just hacked to make it not warn on 'smaller' machines. 
        * Static compiler analysis should mean no extra code
        */
-      if (bytes & (1 << (sizeof (unsigned long) >= 8 ? 39 : 0)))
+      if (bytes & (1UL << (sizeof (unsigned long) >= 8 ? 39 : 0)))
         t++;
       snprintf (buf, len, "%4d TiB", t);
     }