]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Ensure return string is empty before using strcat to construct it.
authorNick Clifton <nickc@redhat.com>
Sun, 24 Nov 2002 08:10:28 +0000 (08:10 +0000)
committerNick Clifton <nickc@gcc.gnu.org>
Sun, 24 Nov 2002 08:10:28 +0000 (08:10 +0000)
From-SVN: r59422

libiberty/ChangeLog
libiberty/make-relative-prefix.c

index 57ff7da31b5c0b6724fdd6cb2af14c25e6bde98c..c58dc1fd7826aa4621392aed8db2384ac5afc629 100644 (file)
@@ -1,3 +1,8 @@
+2002-11-24  Nick Clifton  <nickc@redhat.com>
+
+       * make-relative-prefix.c (make_relative_prefix): Ensure return
+       string is empty before using strcat to construct it.
+
 2002-11-22  Daniel Jacobowitz  <drow@mvista.com>
 
        * Makefile.in: Add make-relative-prefix.c.
index ae1ac54295a86764f5d69e87cea5a85e73b7c825..ef9177e9c93c108a0535bfb3b825722f338dba54 100644 (file)
@@ -362,6 +362,7 @@ make_relative_prefix (progname, bin_prefix, prefix)
     return NULL;
 
   /* Build up the pathnames in argv[0].  */
+  *ret = '\0';
   for (i = 0; i < prog_num; i++)
     strcat (ret, prog_dirs[i]);