summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@home.osdl.org>2003-07-11 22:50:01 -0700
committerLinus Torvalds <torvalds@home.osdl.org>2003-07-11 22:50:01 -0700
commit008a71d28cad1780ea3485916dfafc73a69cf38a (patch)
tree9921fea18ebd2cada6d1fc29268bbe19dc141621 /lib
parent43a14457d6678848a14a6b81690c891400bdde76 (diff)
Fix signedness tests in vsnprintf by making it explicit.
It used to depend on us having a signed type (which in turn is incorrect for the later division).
Diffstat (limited to 'lib')
-rw-r--r--lib/vsprintf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index bc699e295bce..0a12089169a6 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -143,9 +143,9 @@ static char * number(char * buf, char * end, unsigned long long num, int base, i
c = (type & ZEROPAD) ? '0' : ' ';
sign = 0;
if (type & SIGN) {
- if (num < 0) {
+ if ((signed long long) num < 0) {
sign = '-';
- num = -num;
+ num = - (signed long long) num;
size--;
} else if (type & PLUS) {
sign = '+';