From 9650bc35b4aa4ffc35cf99d0e1db64dda5d801c8 Mon Sep 17 00:00:00 2001 From: gramanas Date: Wed, 8 Jun 2022 13:54:49 +0300 Subject: Move from getopt to foodopts --- src/util.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/util.c') 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++; -- cgit v1.2.3