summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-11-14 22:15:35 +0100
committerLennart Poettering <lennart@poettering.net>2012-11-14 22:21:16 +0100
commit7ae03f3697762548e49abb6be5ae7151b1ab9365 (patch)
treeaad1858a156bc2f62137fed054f85a62524a1066
parent02902965822816ec6fcc8a07d008802f17ca1e34 (diff)
specifier: minor modernizations
-rw-r--r--src/shared/specifier.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/shared/specifier.c b/src/shared/specifier.c
index ae00ae10bb..599027cd47 100644
--- a/src/shared/specifier.c
+++ b/src/shared/specifier.c
@@ -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;