[ILUG] C string concat question ??

Kenn Humborg kenn at bluetree.ie
Thu May 3 10:53:38 IST 2001


> < > MSG_SIZE=1;
> < > for (i=0; i<argc; i++) {
> < >   MSG_SIZE += strlen(argv[i]);
> < > }
> < > 
> < > msg = malloc(MSG_SIZE);
> < 
> < Sigh...
> < 
> <    msg = malloc(MSG_SIZE+1);
> 
>   err, isn't that why hes set MSG_SIZE=1; at the start ????

Doh!  And I've no excuse, since I've just had my coffee...

Mutter, mutter, fnurg....

Later,
Kenn





More information about the ILUG mailing list