char *printed = NULL;
Unit *u = userdata;
ExecContext *c;
- int r;
+ int r = 0;
assert(u);
if (r < 0)
return -ENODATA;
- asprintf(&printed, "%lu", (unsigned long) uid);
+ r = asprintf(&printed, UID_FMT, uid);
}
}
if (specifier == 'u')
printed = strdup(username);
else
- asprintf(&printed, "%lu", (unsigned long) uid);
+ r = asprintf(&printed, UID_FMT, uid);
}
- if (!printed)
+ if (r < 0 || !printed)
return -ENOMEM;
*ret = printed;
/* This is similar to unit_name_printf() but also supports
* unescaping. Also, adds a couple of additional codes:
*
- * %f the the instance if set, otherwise the id
+ * %f the instance if set, otherwise the id
* %c cgroup path of unit
* %r where units in this slice are placed in the cgroup tree
* %R the root of this systemd's instance tree