From: Sascha Schumann Date: Sun, 16 Sep 2001 16:03:49 +0000 (+0000) Subject: WS-fix and directly use ap_psprintf instead of sprintf/ap_pstrdup X-Git-Tag: PRE_SUBST_Z_MACROS~92 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7c161fe06984456ac9d9fe3fb107fe4f630230a0;p=php WS-fix and directly use ap_psprintf instead of sprintf/ap_pstrdup --- diff --git a/sapi/apache/mod_php4.c b/sapi/apache/mod_php4.c index bb4b2a30b4..3a248c0ebb 100644 --- a/sapi/apache/mod_php4.c +++ b/sapi/apache/mod_php4.c @@ -587,18 +587,17 @@ static int send_php(request_rec *r, int display_source_mode, char *filename) */ static int send_parsed_php(request_rec * r) { - int result = send_php(r, 0, NULL); + int result = send_php(r, 0, NULL); #if MEMORY_LIMIT - { - char mem_usage[ 32 ]; - TSRMLS_FETCH(); + { + char *mem_usage; + TSRMLS_FETCH(); - sprintf(mem_usage,"%u", (int) AG(allocated_memory_peak)); - AG(allocated_memory_peak)=0; - ap_table_setn(r->notes, "mod_php_memory_usage", ap_pstrdup(r->pool, mem_usage)); - - } + mem_usage = ap_psprintf(r->pool, "%u", AG(allocated_memory_peak)); + AG(allocated_memory_peak) = 0; + ap_table_setn(r->notes, "mod_php_memory_usage", mem_usage); + } #endif return result;