diff options
-rw-r--r-- | runtime/stringbuf.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/runtime/stringbuf.c b/runtime/stringbuf.c index b35fe4ef..6079e685 100644 --- a/runtime/stringbuf.c +++ b/runtime/stringbuf.c @@ -543,8 +543,10 @@ rsRetVal cstrTrimTrailingWhiteSpace(cstr_t *pThis) --i; } /* i now is the new string length! */ - pThis->iStrLen = i; - pThis->pBuf[pThis->iStrLen] = '\0'; /* we always have this space */ + if(i != pThis->iStrLen) { + pThis->iStrLen = i; + pThis->pBuf[pThis->iStrLen] = '\0'; /* we always have this space */ + } done: return RS_RET_OK; } |