]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2004-07-17 Andrew Cagney <cagney@gnu.org>
authorAndrew Cagney <cagney@redhat.com>
Sat, 17 Jul 2004 14:42:29 +0000 (14:42 +0000)
committerAndrew Cagney <cagney@redhat.com>
Sat, 17 Jul 2004 14:42:29 +0000 (14:42 +0000)
* utils.c (xvasprintf): Call xstrvprintf.

gdb/ChangeLog
gdb/utils.c

index e653c6efa4e3c6b01e26be0159535f5cc74aca13..805834e197b28023fd0e48efc36eea7f880b7d6f 100644 (file)
@@ -1,5 +1,7 @@
 2004-07-17  Andrew Cagney  <cagney@gnu.org>
 
+       * utils.c (xvasprintf): Call xstrvprintf.
+
        * parse.c: Update copyright.
        (null_post_parser): Eliminate ARGSUSED.
 
index 409e0bc568a994f44833a3c489ac7b2a1259b6ee..1c7d1f471e59f08a4da719667969766fb8d670b7 100644 (file)
@@ -1173,17 +1173,7 @@ xasprintf (char **ret, const char *format, ...)
 void
 xvasprintf (char **ret, const char *format, va_list ap)
 {
-  int status = vasprintf (ret, format, ap);
-  /* NULL could be returned due to a memory allocation problem; a
-     badly format string; or something else. */
-  if ((*ret) == NULL)
-    internal_error (__FILE__, __LINE__,
-                   "vasprintf returned NULL buffer (errno %d)", errno);
-  /* A negative status with a non-NULL buffer shouldn't never
-     happen. But to be sure. */
-  if (status < 0)
-    internal_error (__FILE__, __LINE__,
-                   "vasprintf call failed (errno %d)", errno);
+  (*ret) = xstrvprintf (format, ap);
 }
 
 char *