From 4c8e9640702d90f9e2c5d5d5f5f9e299c67978eb Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Sat, 15 Oct 2011 14:37:38 +0200 Subject: [PATCH] Fix strip blank space for empty string Signed-off-by: Jens Axboe --- parse.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/parse.c b/parse.c index afbde61e..18e8a400 100644 --- a/parse.c +++ b/parse.c @@ -273,6 +273,8 @@ void strip_blank_front(char **p) { char *s = *p; + if (!strlen(s)) + return; while (isspace((int) *s)) s++; @@ -283,6 +285,9 @@ void strip_blank_end(char *p) { char *start = p, *s; + if (!strlen(p)) + return; + s = strchr(p, ';'); if (s) *s = '\0'; -- 2.25.1