summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'util.c')
-rw-r--r--util.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/util.c b/util.c
index ae02570..ed093df 100644
--- a/util.c
+++ b/util.c
@@ -19,6 +19,8 @@
char *stringcopy(const char *s, int len) {
char *r;
+ if (!s)
+ return NULL;
if (!len)
len = strlen(s);
r = malloc(len + 1);