summaryrefslogtreecommitdiffstats
path: root/src/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c
index 6eda622..a5bc860 100644
--- a/src/util.c
+++ b/src/util.c
@@ -40,6 +40,8 @@ trim(char * str)
int begin = 0;
int end = strlen(str) - 1;
+ if (end == -1) return;
+
while (isspace((unsigned char) str[begin]))
begin++;