chiark
/
gitweb
/
~mdw
/
mLib
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
@@@ more mess
[mLib]
/
utils
/
gprintf.c
diff --git
a/utils/gprintf.c
b/utils/gprintf.c
index 9964d184ea35b786a3967e7ea7a4dcbb108a40c8..45cd35afc9325b34d49fff159fb7880e7a6e224a 100644
(file)
--- a/
utils/gprintf.c
+++ b/
utils/gprintf.c
@@
-572,7
+572,8
@@
int gprintf(const struct gprintf_ops *ops, void *out, const char *p, ...)
/* --- @gprintf_memputf@ --- *
*
/* --- @gprintf_memputf@ --- *
*
- * Arguments: @char **buf_inout@ = address of output buffer pointer
+ * Arguments: @arena *a@ = memory allocation arena
+ * @char **buf_inout@ = address of output buffer pointer
* @size_t *sz_inout@ = address of buffer size
* @size_t maxsz@ = buffer size needed for this operation
* @const char *p@ = pointer to format string
* @size_t *sz_inout@ = address of buffer size
* @size_t maxsz@ = buffer size needed for this operation
* @const char *p@ = pointer to format string
@@
-590,15
+591,16
@@
int gprintf(const struct gprintf_ops *ops, void *out, const char *p, ...)
* buffer, and the formatted string will have been written to
* the buffer.
*
* buffer, and the formatted string will have been written to
* the buffer.
*
- * When the buffer is no longer required, free it using @xfree@.
+ * When the buffer is no longer required, free it using
+ * @x_free@.
*/
*/
-size_t gprintf_memputf(char **buf_inout, size_t *sz_inout,
- size_t maxsz, const char *p, va_list ap)
+size_t gprintf_memputf(
arena *a,
char **buf_inout, size_t *sz_inout,
+
size_t maxsz, const char *p, va_list ap)
{
int n;
{
int n;
- GROWBUF_REPLACE(
&arena_stdlib
, *buf_inout, *sz_inout, maxsz, 64, 1);
+ GROWBUF_REPLACE(
size_t, a
, *buf_inout, *sz_inout, maxsz, 64, 1);
#ifdef HAVE_SNPRINTF
n = vsnprintf(*buf_inout, maxsz + 1, p, ap);
#else
#ifdef HAVE_SNPRINTF
n = vsnprintf(*buf_inout, maxsz + 1, p, ap);
#else