Fix elf64-ppc.c electric fence warning
[deliverable/binutils-gdb.git] / gdb / common / common-utils.c
index 60093a47608482496122bf5d873da67624e324ef..2925dd5660a9f8a0517a462774e9cab5c44527d2 100644 (file)
@@ -1,6 +1,6 @@
 /* Shared general utility routines for GDB, the GNU debugger.
 
-   Copyright (C) 1986-2013 Free Software Foundation, Inc.
+   Copyright (C) 1986-2015 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 "gdb_assert.h"
-
-#include <stdlib.h>
-#include <stdio.h>
+#include "common-defs.h"
 
 /* The xmalloc() (libiberty.h) family of memory management routines.
 
@@ -150,3 +141,13 @@ xsnprintf (char *str, size_t size, const char *format, ...)
 
   return ret;
 }
+
+char *
+savestring (const char *ptr, size_t len)
+{
+  char *p = (char *) xmalloc (len + 1);
+
+  memcpy (p, ptr, len);
+  p[len] = 0;
+  return p;
+}
This page took 0.02571 seconds and 4 git commands to generate.