summaryrefslogtreecommitdiff
path: root/usr.bin/readlink
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1998-07-08 04:36:38 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1998-07-08 04:36:38 +0000
commit86e35671da8b1f5fcf0e2b200230dfb257985e75 (patch)
treebcdfa339f3633ac96bcf0b4c9106090c61dd7c7a /usr.bin/readlink
parented529241701fb9920d4bc889e7e8e0c74564d59b (diff)
use fprintf everytime for consitancy; help !ansi compilers as well
Diffstat (limited to 'usr.bin/readlink')
-rw-r--r--usr.bin/readlink/readlink.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.bin/readlink/readlink.c b/usr.bin/readlink/readlink.c
index 603d4bb0bcb..3d965d09c68 100644
--- a/usr.bin/readlink/readlink.c
+++ b/usr.bin/readlink/readlink.c
@@ -1,5 +1,5 @@
/*
- * $OpenBSD: readlink.c,v 1.14 1998/05/18 19:12:03 deraadt Exp $
+ * $OpenBSD: readlink.c,v 1.15 1998/07/08 04:36:37 mickey Exp $
*
* Copyright (c) 1997
* Kenneth Stailey (hereinafter referred to as the author)
@@ -65,9 +65,12 @@ main(argc, argv)
}
n = strlen(argv[0]);
- if (n > PATH_MAX - 1)
- errx(1, "filename longer than PATH_MAX-1 (%d)\n",
- PATH_MAX - 1);
+ if (n > PATH_MAX - 1) {
+ fprintf(stderr,
+ "readlink: filename longer than PATH_MAX-1 (%d)\n",
+ PATH_MAX - 1);
+ exit(1);
+ }
if (fflag)
realpath(argv[0], buf);