]> granicus.if.org Git - apache/commitdiff
Tweaking code to compile on pre-C99 compilers
authorMartin Kraemer <martin@apache.org>
Mon, 7 Apr 2008 06:14:31 +0000 (06:14 +0000)
committerMartin Kraemer <martin@apache.org>
Mon, 7 Apr 2008 06:14:31 +0000 (06:14 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@645392 13f79535-47bb-0310-9956-ffa450edef68

server/util_cookies.c

index dc04b5bbe653c2e4194634269ce09a587dc68cd6..f7f6b79b09312a71158187263e41755590b663b1 100644 (file)
@@ -38,6 +38,7 @@ AP_DECLARE(apr_status_t) ap_cookie_write(request_rec * r, const char *name, cons
 {
 
     char *buffer;
+    char *rfc2109;
 
     /* handle expiry */
     buffer = "";
@@ -46,10 +47,10 @@ AP_DECLARE(apr_status_t) ap_cookie_write(request_rec * r, const char *name, cons
     }
 
     /* create RFC2109 compliant cookie */
-    char *rfc2109 = apr_pstrcat(r->pool, name, "=", val, ";",
-                                buffer,
-                                attrs && strlen(attrs) > 0 ?
-                                attrs : DEFAULT_ATTRS, NULL);
+    rfc2109 = apr_pstrcat(r->pool, name, "=", val, ";",
+                          buffer,
+                          attrs && strlen(attrs) > 0 ?
+                          attrs : DEFAULT_ATTRS, NULL);
     ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, LOG_PREFIX
                   "user '%s' set cookie: '%s'", r->user, rfc2109);
     apr_table_addn(r->headers_out, SET_COOKIE, rfc2109);
@@ -73,6 +74,7 @@ AP_DECLARE(apr_status_t) ap_cookie_write2(request_rec * r, const char *name2, co
 {
 
     char *buffer;
+    char *rfc2965;
 
     /* handle expiry */
     buffer = "";
@@ -81,10 +83,10 @@ AP_DECLARE(apr_status_t) ap_cookie_write2(request_rec * r, const char *name2, co
     }
 
     /* create RFC2965 compliant cookie */
-    char *rfc2965 = apr_pstrcat(r->pool, name2, "=", val, ";",
-                                buffer,
-                                attrs2 && strlen(attrs2) > 0 ?
-                                attrs2 : DEFAULT_ATTRS, NULL);
+    rfc2965 = apr_pstrcat(r->pool, name2, "=", val, ";",
+                          buffer,
+                          attrs2 && strlen(attrs2) > 0 ?
+                          attrs2 : DEFAULT_ATTRS, NULL);
     ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, LOG_PREFIX
                   "user '%s' set cookie2: '%s'", r->user, rfc2965);
     apr_table_addn(r->headers_out, SET_COOKIE2, rfc2965);