aboutsummaryrefslogtreecommitdiff
path: root/lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib.c b/lib.c
index e8310a9..18adbd2 100644
--- a/lib.c
+++ b/lib.c
@@ -822,10 +822,17 @@ convert:
if (result != NULL)
*result = r;
- retval = (isspace(*ep) || *ep == '\0' || trailing_stuff_ok);
+ /*
+ * check for trailing stuff
+ */
+ while (isspace(*ep))
+ ep++;
if (no_trailing != NULL)
*no_trailing = (*ep == '\0');
+ // return true if found the end, or trailing stuff is allowed
+ retval = *ep == '\0' || trailing_stuff_ok;
+
return retval;
}