# HG changeset patch # User Timo Sirainen # Date 1032142037 -10800 # Node ID 3f92df43cfa7e5f1bab3f68b24c22a182068ed30 # Parent 9277e893304e41652df213fcc43e7f72ac31f0c0 t_push()/t_pop() around various *sprintf() functions, so "%m" format won't eat extra memory. diff -r 9277e893304e -r 3f92df43cfa7 src/lib/strfuncs.c --- a/src/lib/strfuncs.c Sun Sep 15 14:09:08 2002 +0300 +++ b/src/lib/strfuncs.c Mon Sep 16 05:07:17 2002 +0300 @@ -448,9 +448,11 @@ i_assert(max_chars < SSIZE_T_MAX); i_assert(format != NULL); + t_push(); va_start(args, format); ret = vsnprintf(str, max_chars, fix_format(format), args); va_end(args); + t_pop(); if (ret < 0) { str[max_chars-1] = '\0'; @@ -467,10 +469,12 @@ i_assert(max_chars < SSIZE_T_MAX); i_assert(format != NULL); + t_push(); va_start(args, format); format = fix_format(format); buf = t_buffer_get(printf_string_upper_bound(format, args)); va_end(args); + t_pop(); len = vsprintf(buf, format, args); if (len >= (int)max_chars) @@ -647,6 +651,8 @@ if (format == NULL) return NULL; + + t_push(); format = fix_format(format); VA_COPY(temp_args, args); @@ -655,6 +661,7 @@ vsprintf(ret, format, args); va_end(temp_args); + t_pop(); return ret; }