summaryrefslogtreecommitdiff
path: root/runtime/stringbuf.c
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/stringbuf.c')
-rw-r--r--runtime/stringbuf.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/runtime/stringbuf.c b/runtime/stringbuf.c
index cb4f045..13f3871 100644
--- a/runtime/stringbuf.c
+++ b/runtime/stringbuf.c
@@ -107,7 +107,8 @@ finalize_it:
/* a helper function for rsCStr*Strf()
*/
-static rsRetVal rsCStrConstructFromszStrv(cstr_t **ppThis, uchar *fmt, va_list ap)
+static rsRetVal rsCStrConstructFromszStrv(cstr_t **ppThis, char *fmt, va_list ap) __attribute__((format(gnu_printf,2, 0)));
+static rsRetVal rsCStrConstructFromszStrv(cstr_t **ppThis, char *fmt, va_list ap)
{
DEFiRet;
cstr_t *pThis;
@@ -147,7 +148,7 @@ rsRetVal rsCStrConstructFromszStrf(cstr_t **ppThis, char *fmt, ...)
va_list ap;
va_start(ap, fmt);
- iRet = rsCStrConstructFromszStrv(ppThis, (uchar*)fmt, ap);
+ iRet = rsCStrConstructFromszStrv(ppThis, fmt, ap);
va_end(ap);
RETiRet;
@@ -315,7 +316,7 @@ rsRetVal rsCStrAppendStrf(cstr_t *pThis, uchar *fmt, ...)
cstr_t *pStr = NULL;
va_start(ap, fmt);
- iRet = rsCStrConstructFromszStrv(&pStr, fmt, ap);
+ iRet = rsCStrConstructFromszStrv(&pStr, (char*)fmt, ap);
va_end(ap);
CHKiRet(iRet);
@@ -563,7 +564,7 @@ rsRetVal cstrTrimTrailingWhiteSpace(cstr_t *pThis)
}
/* i now is the new string length! */
pThis->iStrLen = i;
- pThis->pBuf[pThis->iStrLen] = '0'; /* we always have this space */
+ pThis->pBuf[pThis->iStrLen] = '\0'; /* we always have this space */
done: return RS_RET_OK;
}