From 26b6c2cf16f54b493c4757c099becc0c9ee0b7f3 Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Mon, 14 Jul 2008 15:00:58 +0000 Subject: Fixed popmessage. --- src/lib/util/astring.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'src/lib/util/astring.c') diff --git a/src/lib/util/astring.c b/src/lib/util/astring.c index 5be6de07a84..5a86d611f89 100644 --- a/src/lib/util/astring.c +++ b/src/lib/util/astring.c @@ -335,6 +335,24 @@ int astring_printf(astring *dst, const char *format, ...) } +/*------------------------------------------------- + astring_vprintf - vprintf text into an astring +-------------------------------------------------*/ + +int astring_vprintf(astring *dst, const char *format, va_list args) +{ + char tempbuf[4096]; + int result; + + /* sprintf into the temporary buffer */ + result = vsprintf(tempbuf, format, args); + + /* set the result */ + astring_cpyc(dst, tempbuf); + return result; +} + + /*------------------------------------------------- astring_catprintf - formatted printf to the end of an astring @@ -357,6 +375,25 @@ int astring_catprintf(astring *dst, const char *format, ...) } +/*------------------------------------------------- + astring_catprintf - formatted vprintf to + the end of an astring +-------------------------------------------------*/ + +int astring_catvprintf(astring *dst, const char *format, va_list args) +{ + char tempbuf[4096]; + int result; + + /* sprintf into the temporary buffer */ + result = vsprintf(tempbuf, format, args); + + /* append the result */ + astring_catc(dst, tempbuf); + return result; +} + + /*************************************************************************** ASTRING QUERIES -- cgit v1.2.3-70-g09d2