aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/wmap_parser.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/wmap_parser.c b/src/wmap_parser.c
index 09ccd69..0d64b08 100644
--- a/src/wmap_parser.c
+++ b/src/wmap_parser.c
@@ -235,11 +235,12 @@ found_separator:
wmap_skip_whitespace(&p, end);
to_start = p;
- /* Find end of 'to' */
- while (p < end && !IS_WHITESPACE(*p)) {
- p++;
+ to_end = end;
+
+ /* Trim trailing whitespace from 'to' */
+ while (to_end > to_start && IS_WHITESPACE(to_end[-1])) {
+ to_end--;
}
- to_end = p;
to_len = to_end - to_start;
if (to_len == 0 || to_len >= WMAP_MAX_NAME_LEN) {