Message-ID: <35E0974D.FC66A85A@gmx.net> Date: Sun, 23 Aug 1998 22:27:25 +0000 From: Robert Hoehne Organization: none provided MIME-Version: 1.0 To: Eli Zaretskii CC: djgpp-workers Subject: Re: Bug in crt1.c (alpha 980712) References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Precedence: bulk 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