aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2005-04-02 20:25:22 +0000
committerMark Kettenis <kettenis@gnu.org>2005-04-02 20:25:22 +0000
commit7509373f99cbb05bd0d2bf51b0516aac954e9ec8 (patch)
treeada691e423898e38c75bd2345f6c03b954d5d33a /gdb
parentaa55ccb12061123ca56c2b61402899b73276d2df (diff)
downloadgdb-7509373f99cbb05bd0d2bf51b0516aac954e9ec8.zip
gdb-7509373f99cbb05bd0d2bf51b0516aac954e9ec8.tar.gz
gdb-7509373f99cbb05bd0d2bf51b0516aac954e9ec8.tar.bz2
* main.c: Update copyright year.
(captured_main): Avois using strcpy and strcat.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/main.c13
2 files changed, 10 insertions, 8 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 96a8e77..f3d49f4 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2005-04-02 Mark Kettenis <kettenis@gnu.org>
+
+ * main.c: Update copyright year.
+ (captured_main): Avois using strcpy and strcat.
+
2005-04-01 Michael Snyder <msnyder@redhat.com>
* dummy-frame.c (dummy_frame_sniffer): Optimization: don't bother
diff --git a/gdb/main.c b/gdb/main.c
index a58f491..6cd703a 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -1,8 +1,8 @@
/* Top level stuff for GDB, the GNU debugger.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
- 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
- Foundation, Inc.
+ 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+ Free Software Foundation, Inc.
This file is part of GDB.
@@ -143,7 +143,7 @@ captured_main (void *data)
int ndir;
struct stat homebuf, cwdbuf;
- char *homedir, *homeinit;
+ char *homedir;
int i;
@@ -600,11 +600,7 @@ extern int gdbtk_test (char *);
homedir = getenv ("HOME");
if (homedir)
{
- homeinit = (char *) alloca (strlen (homedir) +
- strlen (gdbinit) + 10);
- strcpy (homeinit, homedir);
- strcat (homeinit, "/");
- strcat (homeinit, gdbinit);
+ char *homeinit = xstrprintf ("%s/%s", homedir, gdbinit);
if (!inhibit_gdbinit)
{
@@ -622,6 +618,7 @@ extern int gdbtk_test (char *);
stat (homeinit, &homebuf);
stat (gdbinit, &cwdbuf); /* We'll only need this if
homedir was set. */
+ xfree (homeinit);
}
/* Now perform all the actions indicated by the arguments. */