Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(313)

Unified Diff: gdb/common/common-utils.c

Issue 124383005: GDB 7.6.50 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@upstream
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gdb/common/common-utils.h ('k') | gdb/common/create-version.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/common/common-utils.c
diff --git a/gdb/common/common-utils.c b/gdb/common/common-utils.c
index ad01ed658d89ba50a1fd2fa4cae5338b34024655..4f2b78a6afc3dc7e372829e55b46faaaa57f0318 100644
--- a/gdb/common/common-utils.c
+++ b/gdb/common/common-utils.c
@@ -1,6 +1,6 @@
/* Shared general utility routines for GDB, the GNU debugger.
- Copyright (C) 1986, 1988-2012 Free Software Foundation, Inc.
+ Copyright (C) 1986-2013 Free Software Foundation, Inc.
This file is part of GDB.
@@ -24,6 +24,7 @@
#endif
#include "gdb_assert.h"
+#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -137,22 +138,6 @@ xstrvprintf (const char *format, va_list ap)
return ret;
}
-void
-xasprintf (char **ret, const char *format, ...)
-{
- va_list args;
-
- va_start (args, format);
- (*ret) = xstrvprintf (format, args);
- va_end (args);
-}
-
-void
-xvasprintf (char **ret, const char *format, va_list ap)
-{
- (*ret) = xstrvprintf (format, ap);
-}
-
int
xsnprintf (char *str, size_t size, const char *format, ...)
{
@@ -166,3 +151,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;
+}
« no previous file with comments | « gdb/common/common-utils.h ('k') | gdb/common/create-version.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698