Revision 45b23ff8

b/hw/virtio-9p.c
321 321
        } while (num);
322 322
        break;
323 323
    }
324
    case 'U': {
325
        unsigned long num = *(unsigned long *)arg;
326
        do {
327
            ret++;
328
            num = num/10;
329
        } while (num);
330
        break;
331
    }
324 332
    default:
325 333
        printf("Number_to_string: Unknown number format\n");
326 334
        return -1;
......
338 346
    int nr_args = 0;
339 347
    char *arg_char_ptr;
340 348
    unsigned int arg_uint;
349
    unsigned long arg_ulong;
341 350

  
342 351
    /* Find the number of %'s that denotes an argument */
343 352
    for (iter = strstr(iter, "%"); iter; iter = strstr(iter, "%")) {
......
363 372
            arg_uint = va_arg(ap2, unsigned int);
364 373
            len += number_to_string((void *)&arg_uint, 'u');
365 374
            break;
375
        case 'l':
376
            if (*++iter == 'u') {
377
                arg_ulong = va_arg(ap2, unsigned long);
378
                len += number_to_string((void *)&arg_ulong, 'U');
379
            } else {
380
                return -1;
381
            }
382
            break;
366 383
        case 's':
367 384
            arg_char_ptr = va_arg(ap2, char *);
368 385
            len += strlen(arg_char_ptr);

Also available in: Unified diff