You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by sf...@apache.org on 2010/08/04 00:06:25 UTC

svn commit: r982046 - in /httpd/httpd/trunk: modules/proxy/mod_proxy_balancer.c server/util_cookies.c

Author: sf
Date: Tue Aug  3 22:06:24 2010
New Revision: 982046

URL: http://svn.apache.org/viewvc?rev=982046&view=rev
Log:
remove more useless use of strlen

Modified:
    httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c
    httpd/httpd/trunk/server/util_cookies.c

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c?rev=982046&r1=982045&r2=982046&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c Tue Aug  3 22:06:24 2010
@@ -143,7 +143,7 @@ static char *get_path_param(apr_pool_t *
              * Session path was found, get it's value
              */
             ++path;
-            if (strlen(path)) {
+            if (*path) {
                 char *q;
                 path = apr_strtok(apr_pstrdup(pool, path), pathdelims, &q);
                 return path;

Modified: httpd/httpd/trunk/server/util_cookies.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util_cookies.c?rev=982046&r1=982045&r2=982046&view=diff
==============================================================================
--- httpd/httpd/trunk/server/util_cookies.c (original)
+++ httpd/httpd/trunk/server/util_cookies.c Tue Aug  3 22:06:24 2010
@@ -50,10 +50,8 @@ AP_DECLARE(apr_status_t) ap_cookie_write
     }
 
     /* create RFC2109 compliant cookie */
-    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 && *attrs ? attrs : DEFAULT_ATTRS, NULL);
     ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, LOG_PREFIX
                   "user '%s' set cookie: '%s'", r->user, rfc2109);
 
@@ -94,10 +92,8 @@ AP_DECLARE(apr_status_t) ap_cookie_write
     }
 
     /* create RFC2965 compliant cookie */
-    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 && *attrs2 ? attrs2 : DEFAULT_ATTRS, NULL);
     ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, LOG_PREFIX
                   "user '%s' set cookie2: '%s'", r->user, rfc2965);