Show
Ignore:
Timestamp:
10/05/08 00:00:10 (3 months ago)
Author:
mwhitworth
Message:

Fix vsnprintf for negative numbers.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • Whitix/branches/keobject/lib/vsprintf.c

    r1066 r1089  
    7373        { 
    7474                sign='-'; 
    75                 num=- (signed long long)num; 
     75                num= -(signed long long)num; 
    7676        }else 
    7777                sign=(type & PLUS) ? '+' : ((type & SPACE) ? ' ' : 0); 
     
    240240                        ++fmt; 
    241241                } 
     242                 
     243                unsigned long long num=0; 
    242244                 
    243245                switch (*fmt) 
     
    329331                        flags |= SIGN; 
    330332                case 'u': 
    331                         str=number(str, end, VaArg(args,unsigned long),10,fieldWidth, 
    332                                 precision,flags); 
     333                        num = VaArg(args, unsigned int); 
     334                        if (flags & SIGN) 
     335                                num = (signed int)num; 
     336                        str=number(str, end, num, 10, fieldWidth, precision,flags); 
    333337                        break; 
    334338                default: