From 4c0cbcdcc3de4d842f8b43bff8a05df78f2164c3 Mon Sep 17 00:00:00 2001 From: Anthony Pesch Date: Tue, 18 Jul 2017 23:31:39 -0400 Subject: [PATCH] fix for strncpy_trim_spaces when there are no trailing spaces --- src/core/string.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/string.c b/src/core/string.c index 2a37e223..8f487f1a 100644 --- a/src/core/string.c +++ b/src/core/string.c @@ -44,9 +44,9 @@ void strncpy_pad_spaces(char *dst, const char *src, int size) { void strncpy_trim_spaces(char *dst, const char *src, int size) { char mask = 0x0; - dst += size - 1; src += size - 1; - (*dst) = 0; + dst += size - 1; + *(dst + 1) = 0; while (size--) { /* mask off until a valid letter is hit */ if (*src != ' ') {