Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#18 bug in intf-win32.c

closed-fixed
nobody
None
5
2006-08-10
2006-04-11
Anonymous
No

static void
_ifcombo_add(struct ifcombo *ifc, DWORD idx)
{
if (ifc->cnt == ifc->max) {
if (ifc->idx) {
ifc->max *= 2;
ifc->idx = realloc(ifc->idx,
sizeof(ifc->idx[0] * ifc-
>max));
} else {
ifc->max = 8;
ifc->idx = malloc(sizeof(ifc-
>idx[0] * ifc->max));
}
}
ifc->idx[ifc->cnt++] = idx;
}

error:
ifc->idx = realloc(ifc->idx, sizeof(ifc->idx[0] * ifc-
>max));
ifc->idx = malloc(sizeof(ifc->idx[0] * ifc->max));

ok:
ifc->idx = realloc(ifc->idx,(sizeof(ifc->idx[0]) *
ifc->max));
ifc->idx = malloc(sizeof(ifc->idx[0]) * ifc->max);

Discussion

  • Dug Song
    Dug Song
    2006-08-10

    Logged In: YES
    user_id=18578

    thanks, fixed.

    Checking in intf-win32.c;
    /cvsroot/libdnet/libdnet/src/intf-win32.c,v <-- intf-win32.c
    new revision: 1.27; previous revision: 1.26
    done

     
  • Dug Song
    Dug Song
    2006-08-10

    • status: open --> closed-fixed