]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Use %pm in order to save 8k of stack in 'ap_pcfg_strerror'
authorChristophe Jaillet <jailletc36@apache.org>
Sat, 1 Feb 2014 07:55:58 +0000 (07:55 +0000)
committerChristophe Jaillet <jailletc36@apache.org>
Sat, 1 Feb 2014 07:55:58 +0000 (07:55 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1563379 13f79535-47bb-0310-9956-ffa450edef68

server/util.c

index 7a9e47cf467f70a1e36ab82735b1e053bed55d47..5ceb9a8df3a6cdd045e5d821e1406bb338fcb886 100644 (file)
@@ -957,13 +957,15 @@ AP_DECLARE(apr_status_t) ap_cfg_getc(char *ch, ap_configfile_t *cfp)
 AP_DECLARE(const char *) ap_pcfg_strerror(apr_pool_t *p, ap_configfile_t *cfp,
                                           apr_status_t rc)
 {
-    char buf[MAX_STRING_LEN];
     if (rc == APR_SUCCESS)
         return NULL;
-    return apr_psprintf(p, "Error reading %s at line %d: %s",
-                        cfp->name, cfp->line_number,
-                        rc == APR_ENOSPC ? "Line too long"
-                                         : apr_strerror(rc, buf, sizeof(buf)));
+
+    if (rc == APR_ENOSPC)
+        return apr_psprintf(p, "Error reading %s at line %d: Line too long",
+                            cfp->name, cfp->line_number);
+
+    return apr_psprintf(p, "Error reading %s at line %d: %pm",
+                        cfp->name, cfp->line_number, &rc);
 }
 
 /* Read one line from open ap_configfile_t, strip LF, increase line number */