]> granicus.if.org Git - php/commitdiff
WS-fix and directly use ap_psprintf instead of sprintf/ap_pstrdup
authorSascha Schumann <sas@php.net>
Sun, 16 Sep 2001 16:03:49 +0000 (16:03 +0000)
committerSascha Schumann <sas@php.net>
Sun, 16 Sep 2001 16:03:49 +0000 (16:03 +0000)
sapi/apache/mod_php4.c

index bb4b2a30b424d9ecbb4687f0eb46c2eaed55e5fe..3a248c0ebb93222f66b84bc4b2d1970fdb34979e 100644 (file)
@@ -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;