Fix regression: cannot start with LD_PRELOAD=libSegFault.so (PR gdb/18653#c7)
[deliverable/binutils-gdb.git] / gdb / common / gdb_vecs.c
index 4a3330f596959322e3cc2751eac4a9790f74e152..a2214606255251ac81866aa95fd30d57d13ecc61 100644 (file)
@@ -1,6 +1,6 @@
 /* Some commonly-used VEC types.
 
-   Copyright (C) 2012-2014 Free Software Foundation, Inc.
+   Copyright (C) 2012-2018 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#ifdef GDBSERVER
-#include "server.h"
-#else
-#include "defs.h"
-#endif
-
+#include "common-defs.h"
 #include "gdb_vecs.h"
 #include "host-defs.h"
 
@@ -54,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)
@@ -65,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.026293 seconds and 4 git commands to generate.