summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dive.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/dive.h b/dive.h
index f07c9d9b2..318f822e7 100644
--- a/dive.h
+++ b/dive.h
@@ -32,7 +32,7 @@ static inline int same_string(const char *a, const char *b)
static inline char *copy_string(const char *s)
{
- return s ? strdup(s) : NULL;
+ return (s && *s) ? strdup(s) : NULL;
}
#include <libxml/tree.h>