summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--linux.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/linux.c b/linux.c
index 3ffd997a1..8f8ec6076 100644
--- a/linux.c
+++ b/linux.c
@@ -55,7 +55,11 @@ const char *system_default_filename(void)
int len;
home = getenv("HOME");
+ if (!home)
+ home = "~";
user = getenv("LOGNAME");
+ if (!user)
+ user = "default";
len = strlen(home) + strlen(user) + 17;
buffer = malloc(len);
snprintf(buffer, len, "%s/subsurface/%s.xml", home, user);