expanding argv[]

Shankar Unni shankar at hpclscu.HP.COM
Sat Oct 8 03:22:57 AEST 1988


> There is nothing particularly Pascal-ish about this.  It is, however,
> wrong.  argv[] is not allocated by malloc(), or not guaranteed to be so
> allocated, and therefore it is wrong to call realloc on it.

Whoops! foot-in-mouth.

I remember now (sound of slapping on forehead :-))! Well, go on, use calloc
instead and copy over the existing argv array..
--
Shankar



More information about the Comp.lang.c mailing list