diff options
author | Ruediger Meier | 2016-12-01 09:52:04 +0100 |
---|---|---|
committer | Karel Zak | 2016-12-07 12:35:24 +0100 |
commit | c6ba16c6a45eb3ad7a8b7390416ddb7b5eec3a31 (patch) | |
tree | 9f48655c06359298e81620f9e400627f4f7c31e0 | |
parent | docs: kill(1): Wording fix (diff) | |
download | kernel-qcow2-util-linux-c6ba16c6a45eb3ad7a8b7390416ddb7b5eec3a31.tar.gz kernel-qcow2-util-linux-c6ba16c6a45eb3ad7a8b7390416ddb7b5eec3a31.tar.xz kernel-qcow2-util-linux-c6ba16c6a45eb3ad7a8b7390416ddb7b5eec3a31.zip |
last: include libgen.h for basename(3p)
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
-rw-r--r-- | login-utils/last.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/login-utils/last.c b/login-utils/last.c index 6d0e8920a..90eee68e5 100644 --- a/login-utils/last.c +++ b/login-utils/last.c @@ -40,6 +40,7 @@ #include <netinet/in.h> #include <netdb.h> #include <arpa/inet.h> +#include <libgen.h> #include "c.h" #include "nls.h" @@ -877,7 +878,11 @@ static void process_wtmp_file(const struct last_control *ctl, } } - printf(_("\n%s begins %s"), basename(filename), ctime(&begintime)); + { + char* tmp = xstrdup(filename); + printf(_("\n%s begins %s"), basename(tmp), ctime(&begintime)); + free(tmp); + } fclose(fp); for (p = ulist; p; p = next) { |