From: "Eli Zaretskii" <eliz@gnu.org>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: gdb-patches@sourceware.org
Subject: Re: [COMMIT] Don't use strcpy and strcat in main.c
Date: Sun, 03 Apr 2005 03:29:00 -0000 [thread overview]
Message-ID: <01c537fc$Blat.v2.4$f2cdff80@zahav.net.il> (raw)
In-Reply-To: <200504022025.j32KPRm6014345@elgar.sibelius.xs4all.nl> (message from Mark Kettenis on Sat, 2 Apr 2005 22:25:27 +0200 (CEST))
> Date: Sat, 2 Apr 2005 22:25:27 +0200 (CEST)
> From: Mark Kettenis <mark.kettenis@xs4all.nl>
>
> Index: ChangeLog
> from Mark Kettenis <kettenis@gnu.org>
>
> * 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?
prev parent reply other threads:[~2005-04-03 3:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-02 20:25 Mark Kettenis
2005-04-03 3:29 ` Eli Zaretskii [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='01c537fc$Blat.v2.4$f2cdff80@zahav.net.il' \
--to=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=mark.kettenis@xs4all.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox