summaryrefslogtreecommitdiff
path: root/usr.bin/tip
diff options
context:
space:
mode:
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 {