summaryrefslogtreecommitdiff
path: root/readlink.c
diff options
context:
space:
mode:
authorEric Andersen2001-05-07 17:48:28 +0000
committerEric Andersen2001-05-07 17:48:28 +0000
commit28355a36da6ad4d1b55ba9bb146fb0b6586e7edb (patch)
treed08439547c9b94e1d0211fb0de91e68fc3180fe4 /readlink.c
parent822c3837f95a355f90d25aaabeb2445bb5eb1bf0 (diff)
downloadbusybox-28355a36da6ad4d1b55ba9bb146fb0b6586e7edb.zip
busybox-28355a36da6ad4d1b55ba9bb146fb0b6586e7edb.tar.gz
Per some comments from Lars Kellogg-Stedman <lars@larsshack.org>,
make xreadlink() return NULL on failure, and make sure everyone uses the interface correctly. -Erik
Diffstat (limited to 'readlink.c')
-rw-r--r--readlink.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/readlink.c b/readlink.c
index 2266495..c46ebd1 100644
--- a/readlink.c
+++ b/readlink.c
@@ -37,6 +37,8 @@ int readlink_main(int argc, char **argv)
show_usage();
buf = xreadlink(argv[1]);
+ if (!buf)
+ return EXIT_FAILURE;
puts(buf);
#ifdef BB_FEATURE_CLEAN_UP
free(buf);