summaryrefslogtreecommitdiff
path: root/usr.bin/tip
diff options
context:
space:
mode:
authorJordan Sissel <jls@FreeBSD.org>2007-02-23 18:41:12 +0000
committerJordan Sissel <jls@FreeBSD.org>2007-02-23 18:41:12 +0000
commitee35eb7aa15505be53d6c190103f9a7c53a93a7a (patch)
tree3f497ea240b99493603383db1f34e43140d91765 /usr.bin/tip
parentc8651f7400a44ab77729564785bad008acbe8400 (diff)
downloadsrc-test2-ee35eb7aa15505be53d6c190103f9a7c53a93a7a.tar.gz
src-test2-ee35eb7aa15505be53d6c190103f9a7c53a93a7a.zip
Notes
Diffstat (limited to 'usr.bin/tip')
-rw-r--r--usr.bin/tip/tip/value.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/tip/tip/value.c b/usr.bin/tip/tip/value.c
index 45ee7ceb12d7..b6cf5c2a4411 100644
--- a/usr.bin/tip/tip/value.c
+++ b/usr.bin/tip/tip/value.c
@@ -74,7 +74,11 @@ vinit(void)
* Read the .tiprc file in the HOME directory
* for sets
*/
- if (strlen(value(HOME)) + sizeof("/.tiprc") > sizeof(file)) {
+ cp = value(HOME);
+ if (cp == NULL) {
+ (void)fprintf(stderr,
+ "$HOME not set. Skipping check for ~/.tiprc\n");
+ } else if (strlen(cp) + sizeof("/.tiprc") > sizeof(file)) {
(void)fprintf(stderr, "Home directory path too long: %s\n",
value(HOME));
} else {