Revision ac4ffb5a

b/usb-linux.c
1449 1449
    return 0;
1450 1450
}
1451 1451

  
1452
static void dec2str(int val, char *str)
1452
static void dec2str(int val, char *str, size_t size)
1453 1453
{
1454 1454
    if (val == -1)
1455
        strcpy(str, "*");
1455
        snprintf(str, size, "*");
1456 1456
    else
1457
        sprintf(str, "%d", val); 
1457
        snprintf(str, size, "%d", val); 
1458 1458
}
1459 1459

  
1460
static void hex2str(int val, char *str)
1460
static void hex2str(int val, char *str, size_t size)
1461 1461
{
1462 1462
    if (val == -1)
1463
        strcpy(str, "*");
1463
        snprintf(str, size, "*");
1464 1464
    else
1465
        sprintf(str, "%x", val);
1465
        snprintf(str, size, "%x", val);
1466 1466
}
1467 1467

  
1468 1468
void usb_host_info(void)
......
1475 1475
        term_printf("  Auto filters:\n");
1476 1476
    for (f = usb_auto_filter; f; f = f->next) {
1477 1477
        char bus[10], addr[10], vid[10], pid[10];
1478
        dec2str(f->bus_num, bus);
1479
        dec2str(f->addr, addr);
1480
        hex2str(f->vendor_id, vid);
1481
        hex2str(f->product_id, pid);
1478
        dec2str(f->bus_num, bus, sizeof(bus));
1479
        dec2str(f->addr, addr, sizeof(addr));
1480
        hex2str(f->vendor_id, vid, sizeof(vid));
1481
        hex2str(f->product_id, pid, sizeof(pid));
1482 1482
    	term_printf("    Device %s.%s ID %s:%s\n", bus, addr, vid, pid);
1483 1483
    }
1484 1484
}

Also available in: Unified diff