Ticket #21088: ifstat-size_t.diff

File ifstat-size_t.diff, 658 bytes (added by mpapamanz@…, 15 years ago)
  • drivers.c

     
    593593  int ifcount[] = {
    594594    CTL_NET, PF_LINK, NETLINK_GENERIC, IFMIB_SYSTEM, IFMIB_IFCOUNT
    595595  };
    596   int count, size;
     596  int count;
     597  size_t size;
    597598 
    598599  size = sizeof(count);
    599600  if (sysctl(ifcount, sizeof(ifcount) / sizeof(int), &count, &size, NULL, 0) < 0) {
     
    607608  int ifinfo[] = {
    608609    CTL_NET, PF_LINK, NETLINK_GENERIC, IFMIB_IFDATA, index, IFDATA_GENERAL
    609610  };
    610   int size = sizeof(*ifmd);
     611  size_t size = sizeof(*ifmd);
    611612
    612613  if (sysctl(ifinfo, sizeof(ifinfo) / sizeof(int), ifmd, &size, NULL, 0) < 0)
    613614    return 0;