diff options
author | paul <paul> | 2008-01-08 13:50:11 +0000 |
---|---|---|
committer | paul <paul> | 2008-01-08 13:50:11 +0000 |
commit | 350ee4f8bd0d66610f00f0493f273bf61530ced2 (patch) | |
tree | add0e855bc5b0b9755f0bf9836874f8850e6bca3 | |
parent | cd4fa9a5406162f1e05700f8c3fc180c78dff26f (diff) | |
download | quagga-350ee4f8bd0d66610f00f0493f273bf61530ced2.tar.bz2 quagga-350ee4f8bd0d66610f00f0493f273bf61530ced2.tar.xz |
[lib] add mising UL qualifier to numerical constant
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.
-rw-r--r-- | lib/ChangeLog | 6 | ||||
-rw-r--r-- | lib/memory.c | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog index bd66f071..bbbdfab0 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -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 diff --git a/lib/memory.c b/lib/memory.c index eb670722..9ed5e100 100644 --- a/lib/memory.c +++ b/lib/memory.c @@ -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); } |