main: uid_to_name() might theoretically fail, handle that

This commit is contained in:
Lennart Poettering
2017-11-17 11:28:17 +01:00
parent 1e41242e11
commit a68aef7a95
+2 -2
View File
@@ -1892,8 +1892,8 @@ int main(int argc, char *argv[]) {
_cleanup_free_ char *t;
t = uid_to_name(getuid());
log_debug(PACKAGE_STRING " running in %suser mode for user "UID_FMT"/%s. (" SYSTEMD_FEATURES ")",
arg_action == ACTION_TEST ? " test" : "", getuid(), t);
log_debug(PACKAGE_STRING " running in %suser mode for user " UID_FMT "/%s. (" SYSTEMD_FEATURES ")",
arg_action == ACTION_TEST ? " test" : "", getuid(), strna(t));
}
if (arg_action == ACTION_RUN) {