]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Remove now unused x_asprintf()
authorJoel Rosdahl <joel@rosdahl.net>
Sat, 17 Jul 2010 21:06:19 +0000 (23:06 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Sat, 17 Jul 2010 21:06:19 +0000 (23:06 +0200)
ccache.h
util.c

index cc7119ca45887838b4a836d387e35116212ce171..b55251153937b1070a57a36c7e1cf73889cbb891 100644 (file)
--- a/ccache.h
+++ b/ccache.h
@@ -87,7 +87,6 @@ char *format_hash_as_string(const unsigned char *hash, unsigned size);
 int create_hash_dir(char **dir, const char *hash, const char *cache_dir);
 int create_cachedirtag(const char *dir);
 char *format(const char *format, ...) ATTR_FORMAT(printf, 1, 2);
-void x_asprintf(char **ptr, const char *format, ...) ATTR_FORMAT(printf, 2, 3);
 char *x_strdup(const char *s);
 char *x_strndup(const char *s, size_t n);
 void *x_realloc(void *ptr, size_t size);
diff --git a/util.c b/util.c
index 995ee4aa96366cbfe963392f03f13e1a2b7ec43c..ae3d94039b3636a11f8e6ad486ee1c962588aada 100644 (file)
--- a/util.c
+++ b/util.c
@@ -487,24 +487,6 @@ format(const char *format, ...)
        return ptr;
 }
 
-/*
-  this is like asprintf() but dies if the malloc fails
-  note that we use vsnprintf in a rather poor way to make this more portable
-*/
-void x_asprintf(char **ptr, const char *format, ...)
-{
-       va_list ap;
-
-       *ptr = NULL;
-       va_start(ap, format);
-       if (vasprintf(ptr, format, ap) == -1) {
-               fatal("Out of memory in x_asprintf");
-       }
-       va_end(ap);
-
-       if (!*ptr) fatal("Out of memory in x_asprintf");
-}
-
 /*
   this is like strdup() but dies if the malloc fails
 */