summaryrefslogtreecommitdiff
path: root/clients/xzwrite/gethomedir.c
diff options
context:
space:
mode:
Diffstat (limited to 'clients/xzwrite/gethomedir.c')
-rw-r--r--clients/xzwrite/gethomedir.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/clients/xzwrite/gethomedir.c b/clients/xzwrite/gethomedir.c
index 5c3d372..ffd25bf 100644
--- a/clients/xzwrite/gethomedir.c
+++ b/clients/xzwrite/gethomedir.c
@@ -1,5 +1,6 @@
#include <stdio.h>
#include <pwd.h>
+#include "xzwrite.h"
char *get_home_dir()
{
@@ -8,7 +9,7 @@ char *get_home_dir()
if (h) return h;
- if (h = (char *) getenv("HOME")) return h;
+ if ((h = getenv("HOME")) != NULL) return h;
pwuid = getpwuid(getuid());
return (pwuid->pw_dir);