In article <[email protected]>, matthew green <[email protected]> wrote: >Christos Zoulas writes: >> In article <[email protected]>, >> matthew green <[email protected]> wrote: >> >-=-=-=-=-=- >> >> >+ memcpy(intrnames, inames, MAX_INAME_LENGTH); >> >> That should be: >> memcpy(intrnames, inames, sizeof(intrnames)); > >well. > >maybe. but it's not really any better. intrnames is not >defined with MAX_INAME_LENGTH so using it in any place is >still a hack... > >ie, the length is actually eintrnames-intrnames, but i am >not aware of a way to do that in pure C (leaving the names >as they are now, which they're needed for vmstat. it needs >'eintrnames' to know the end of the list of strings.) > >i'd like to replace it with a much less gross setup but i >didn't see one... > >and the good thing is, gcc will whine if it grows ;)
Yes, the good thing about the sizeof(intrnames) is that if the type changes it is still right... christos
