]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Use x_asprintf() instead of asprintf() + fatal()
authorJoel Rosdahl <joel@rosdahl.net>
Thu, 10 Dec 2009 20:55:30 +0000 (21:55 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Tue, 5 Jan 2010 17:53:03 +0000 (18:53 +0100)
util.c

diff --git a/util.c b/util.c
index dc9d5dda730647ae627c75e664f238a6786bb33f..32d521c0689993749289287113fabc583c4d9690 100644 (file)
--- a/util.c
+++ b/util.c
@@ -259,9 +259,7 @@ const char *tmp_string(void)
                gethostname(hostname, sizeof(hostname)-1);
 #endif
                hostname[sizeof(hostname)-1] = 0;
-               if (asprintf(&ret, "%s.%u", hostname, (unsigned)getpid()) == -1) {
-                       fatal("could not allocate tmp_string\n");
-               }
+               x_asprintf(&ret, "%s.%u", hostname, (unsigned)getpid());
        }
 
        return ret;