ia64/xen-unstable

changeset 2085:054be53e2b9d

bitkeeper revision 1.1150 (41120577g9fFRK1fSLMW6p4QnOuLrQ)

Overflows in the printing routine fixed.
author gm281@boulderdash.cl.cam.ac.uk
date Thu Aug 05 10:01:27 2004 +0000 (2004-08-05)
parents 81aca503df11
children 4cccb33cf202
files xen/common/vsprintf.c
line diff
     1.1 --- a/xen/common/vsprintf.c	Wed Aug 04 21:55:50 2004 +0000
     1.2 +++ b/xen/common/vsprintf.c	Thu Aug 05 10:01:27 2004 +0000
     1.3 @@ -123,7 +123,7 @@ static int skip_atoi(const char **s)
     1.4  #define SPECIAL	32		/* 0x */
     1.5  #define LARGE	64		/* use 'ABCDEF' instead of 'abcdef' */
     1.6  
     1.7 -static char * number(char * buf, char * end, long num, int base, int size, int precision, int type)
     1.8 +static char * number(char * buf, char * end, long long num, int base, int size, int precision, int type)
     1.9  {
    1.10      char c,sign,tmp[66];
    1.11      const char *digits;
    1.12 @@ -163,7 +163,7 @@ static char * number(char * buf, char * 
    1.13      else 
    1.14      {
    1.15          /* XXX KAF: force unsigned mod and div. */
    1.16 -        unsigned long num2=(unsigned long)num;
    1.17 +        unsigned long long num2=(unsigned long long)num;
    1.18          unsigned int base2=(unsigned int)base;
    1.19          while (num2 != 0) { tmp[i++] = digits[num2%base2]; num2 /= base2; }
    1.20      }