fix for strncpy_trim_spaces when there are no trailing spaces

This commit is contained in:
Anthony Pesch 2017-07-18 23:31:39 -04:00
parent 2f2f5de719
commit 4c0cbcdcc3
1 changed files with 2 additions and 2 deletions

View File

@ -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 != ' ') {