summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util/astring.c
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2008-07-14 15:00:58 +0000
committer Aaron Giles <aaron@aarongiles.com>2008-07-14 15:00:58 +0000
commit26b6c2cf16f54b493c4757c099becc0c9ee0b7f3 (patch)
tree7470a616ba8a1ad070300b89818b57c0d0f0ec06 /src/lib/util/astring.c
parent89675377ca828f07dfeed2042d12c484bf76e49e (diff)
Fixed popmessage.
Diffstat (limited to 'src/lib/util/astring.c')
-rw-r--r--src/lib/util/astring.c37
1 files changed, 37 insertions, 0 deletions
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
@@ -336,6 +336,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