Avoid strndup in gcc.c (PR bootstrap/67363)
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Mon, 31 Aug 2015 11:19:42 +0000 (11:19 +0000)
committerRainer Orth <ro@gcc.gnu.org>
Mon, 31 Aug 2015 11:19:42 +0000 (11:19 +0000)
PR bootstrap/67363
* gcc.c (env_manager::xput): Replace strndup by xstrndup.

From-SVN: r227337

gcc/ChangeLog
gcc/gcc.c

index a0123b12ad6a47f18dba5f75fa1a64ab486187a7..88ccb221be03cbc233ad4737a9689ca9d7541310 100644 (file)
@@ -1,3 +1,8 @@
+2015-08-31  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       PR bootstrap/67363
+       * gcc.c (env_manager::xput): Replace strndup by xstrndup.
+
 2015-08-31  Tom de Vries  <tom@codesourcery.com>
 
        * tree-ssa-loop-manip.c (find_uses_to_rename_use)
index 86c24192aabd4cfdaac99a785294272a85599aa9..757bfc988eb041dba723068ed06e5bfd68030f22 100644 (file)
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -123,7 +123,7 @@ env_manager::xput (const char *string)
       gcc_assert (equals);
 
       struct kv kv;
-      kv.m_key = strndup (string, equals - string);
+      kv.m_key = xstrndup (string, equals - string);
       const char *cur_value = ::getenv (kv.m_key);
       if (m_debug)
        fprintf (stderr, "saving old value: %s\n",cur_value);