summaryrefslogtreecommitdiffstats
path: root/src/util.c
diff options
context:
space:
mode:
authorgramanas <anastasis.gramm2@gmail.com>2022-06-08 13:54:49 +0300
committergramanas <anastasis.gramm2@gmail.com>2022-06-08 13:54:49 +0300
commit9650bc35b4aa4ffc35cf99d0e1db64dda5d801c8 (patch)
tree1d3c373f141324141d2293dcff3c64a29c9d9de9 /src/util.c
parentf20c12dd9f920eee1f50f99c8a4c86730e40432c (diff)
downloadfoodtools-9650bc35b4aa4ffc35cf99d0e1db64dda5d801c8.tar.gz
foodtools-9650bc35b4aa4ffc35cf99d0e1db64dda5d801c8.tar.bz2
foodtools-9650bc35b4aa4ffc35cf99d0e1db64dda5d801c8.zip
Move from getopt to foodopts
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++;