Fix regression: cannot start with LD_PRELOAD=libSegFault.so (PR gdb/18653#c7)
[deliverable/binutils-gdb.git] / gdb / common / gdb_vecs.c
index 84424f87b7bec65118f6d098db8b207c30875c3f..a2214606255251ac81866aa95fd30d57d13ecc61 100644 (file)
@@ -1,6 +1,6 @@
 /* Some commonly-used VEC types.
 
-   Copyright (C) 2012-2015 Free Software Foundation, Inc.
+   Copyright (C) 2012-2018 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -49,7 +49,8 @@ delim_string_to_char_ptr_vec_append (VEC (char_ptr) **vecp,
   do
     {
       size_t this_len;
-      char *next_field, *this_field;
+      const char *next_field;
+      char *this_field;
 
       next_field = strchr (str, delimiter);
       if (next_field == NULL)
@@ -60,7 +61,7 @@ delim_string_to_char_ptr_vec_append (VEC (char_ptr) **vecp,
          next_field++;
        }
 
-      this_field = xmalloc (this_len + 1);
+      this_field = (char *) xmalloc (this_len + 1);
       memcpy (this_field, str, this_len);
       this_field[this_len] = '\0';
       VEC_safe_push (char_ptr, *vecp, this_field);
This page took 0.025057 seconds and 4 git commands to generate.