Mail Archives: djgpp-workers/1998/08/23/16:35:24
Eli Zaretskii wrote :
>
> This is ANSI requirement: strncpy should pad with zeroes if the second
> argument is shorter than what the third specifies.
That was the reason, why I said, I don't know, since I don't
know the ANSI spec.
>
> Then why not just calloc(17)? Or, better yet, use strncat?
>
That might be all correct, but can someone tell me, why
my patch is not good. What do you have against using
strcpy()? I really don't understand why you try to make
such an easy thing such complicated.
If I would write it in _MY_ code, I would write the two
lines from crt1.c
prog_name = (char *)calloc(1, strlen(fc) + 1);
strncpy(prog_name, fc, 16);
such
prog_name = strdup(fc);
(or have I missed something?)
Robert
- Raw text -