chiark / gitweb /
specifier: minor modernizations
authorLennart Poettering <lennart@poettering.net>
Wed, 14 Nov 2012 21:15:35 +0000 (22:15 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 14 Nov 2012 21:21:16 +0000 (22:21 +0100)
src/shared/specifier.c

index ae00ae10bbf303fbb67ccbb5349ce65208b02095..599027cd47e795f7ffc42304601ccddcbf017cf4 100644 (file)
@@ -41,7 +41,8 @@ char *specifier_printf(const char *text, const Specifier table[], void *userdata
         assert(table);
 
         l = strlen(text);
-        if (!(r = new(char, l+1)))
+        r = new(char, l+1);
+        if (!r)
                 return NULL;
 
         t = r;
@@ -62,7 +63,8 @@ char *specifier_printf(const char *text, const Specifier table[], void *userdata
                                         char *n, *w;
                                         size_t k, j;
 
-                                        if (!(w = i->lookup(i->specifier, i->data, userdata))) {
+                                        w = i->lookup(i->specifier, i->data, userdata);
+                                        if (!w) {
                                                 free(r);
                                                 return NULL;
                                         }
@@ -70,7 +72,8 @@ char *specifier_printf(const char *text, const Specifier table[], void *userdata
                                         j = t - r;
                                         k = strlen(w);
 
-                                        if (!(n = new(char, j + k + l + 1))) {
+                                        n = new(char, j + k + l + 1);
+                                        if (!n) {
                                                 free(r);
                                                 free(w);
                                                 return NULL;