From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18898 invoked by alias); 3 Apr 2005 03:29:35 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 18862 invoked from network); 3 Apr 2005 03:29:31 -0000 Received: from unknown (HELO romy.inter.net.il) (192.114.186.66) by sourceware.org with SMTP; 3 Apr 2005 03:29:31 -0000 Received: from zaretski (IGLD-80-230-67-97.inter.net.il [80.230.67.97]) by romy.inter.net.il (MOS 3.5.6-GR) with ESMTP id AWW06147 (AUTH halo1); Sun, 3 Apr 2005 06:29:28 +0300 (IDT) Date: Sun, 03 Apr 2005 03:29:00 -0000 From: "Eli Zaretskii" To: Mark Kettenis Message-ID: <01c537fc$Blat.v2.4$f2cdff80@zahav.net.il> Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=ISO-8859-1 CC: gdb-patches@sourceware.org In-reply-to: <200504022025.j32KPRm6014345@elgar.sibelius.xs4all.nl> (message from Mark Kettenis on Sat, 2 Apr 2005 22:25:27 +0200 (CEST)) Subject: Re: [COMMIT] Don't use strcpy and strcat in main.c Reply-to: Eli Zaretskii References: <200504022025.j32KPRm6014345@elgar.sibelius.xs4all.nl> X-SW-Source: 2005-04/txt/msg00033.txt.bz2 > Date: Sat, 2 Apr 2005 22:25:27 +0200 (CEST) > From: Mark Kettenis > > Index: ChangeLog > from Mark Kettenis > > * main.c: Update copyright year. > (captured_main): Avois using strcpy and strcat. ^^^^^ A typo. > - homeinit = (char *) alloca (strlen (homedir) + > - strlen (gdbinit) + 10); > - strcpy (homeinit, homedir); > - strcat (homeinit, "/"); > - strcat (homeinit, gdbinit); > + char *homeinit = xstrprintf ("%s/%s", homedir, gdbinit); Why was the original code unworthy? because it used alloca?