about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--througha.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/througha.c b/througha.c
index 1d0c3d5..d5cf71c 100644
--- a/througha.c
+++ b/througha.c
@@ -21,8 +21,12 @@ void usage(const char *name, const char *message)
 size_t get_envname(char *dest, const char *var)
 {
     size_t i = 0;
+
+    if (dest == NULL || var == NULL) return 0;
+
     while ((dest[i] = tolower(var[i])) != '=') ++i;
     dest[i] = '\0';
+
     return i;
 }