From 9959f80ee64c0beb86338f94f41ef8a873ab38d1 Mon Sep 17 00:00:00 2001 From: Tomas Heinrich Date: Wed, 20 Mar 2013 19:13:59 +0100 Subject: Add new string functions that take a printf-style fmt --- runtime/stringbuf.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'runtime/stringbuf.h') diff --git a/runtime/stringbuf.h b/runtime/stringbuf.h index bba004a0..b301f4b9 100644 --- a/runtime/stringbuf.h +++ b/runtime/stringbuf.h @@ -58,6 +58,7 @@ rsRetVal cstrConstruct(cstr_t **ppThis); rsRetVal cstrConstructFromESStr(cstr_t **ppThis, es_str_t *str); rsRetVal rsCStrConstructFromszStr(cstr_t **ppThis, uchar *sz); rsRetVal rsCStrConstructFromCStr(cstr_t **ppThis, cstr_t *pFrom); +rsRetVal rsCStrConstructFromszStrf(cstr_t **ppThis, uchar *fmt, ...); /** * Destruct the string buffer object. @@ -173,6 +174,12 @@ rsRetVal rsCStrAppendStr(cstr_t *pThis, uchar* psz); */ rsRetVal rsCStrAppendStrWithLen(cstr_t *pThis, uchar* psz, size_t iStrLen); +/** + * Append a printf-style formated string to the buffer. + * + * \param fmt pointer to the format string (see man 3 printf for details). Must not be NULL. + */ +rsRetVal rsCStrAppendStrf(cstr_t *pThis, uchar *fmt, ...); /** * Append an integer to the string. No special formatting is -- cgit v1.2.3 From bcc0f0ae4df189a57bc5dd042d31aeed876b8e36 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Mon, 13 May 2013 08:23:17 +0200 Subject: bugfix: invalid addressing in string class (recent regression) --- runtime/stringbuf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/stringbuf.h') diff --git a/runtime/stringbuf.h b/runtime/stringbuf.h index b301f4b9..d0502a5b 100644 --- a/runtime/stringbuf.h +++ b/runtime/stringbuf.h @@ -58,7 +58,7 @@ rsRetVal cstrConstruct(cstr_t **ppThis); rsRetVal cstrConstructFromESStr(cstr_t **ppThis, es_str_t *str); rsRetVal rsCStrConstructFromszStr(cstr_t **ppThis, uchar *sz); rsRetVal rsCStrConstructFromCStr(cstr_t **ppThis, cstr_t *pFrom); -rsRetVal rsCStrConstructFromszStrf(cstr_t **ppThis, uchar *fmt, ...); +rsRetVal rsCStrConstructFromszStrf(cstr_t **ppThis, char *fmt, ...) __attribute__((format(printf,2, 3))); /** * Destruct the string buffer object. -- cgit v1.2.3