]> granicus.if.org Git - apache/commitdiff
remove more useless use of strlen
authorStefan Fritsch <sf@apache.org>
Tue, 3 Aug 2010 22:06:24 +0000 (22:06 +0000)
committerStefan Fritsch <sf@apache.org>
Tue, 3 Aug 2010 22:06:24 +0000 (22:06 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@982046 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/mod_proxy_balancer.c
server/util_cookies.c

index a2af29d93a8ff80943a47fe52faa14aff6d62e4c..444ce64e694f48eb8c0e175298454f59a9456be2 100644 (file)
@@ -143,7 +143,7 @@ static char *get_path_param(apr_pool_t *pool, char *url,
              * 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;
index 5e00fc6c5fc57ab445c267ff9d879ce769275f26..3b3c952382780ad4c51dd22bd19e9f1bf89df171 100644 (file)
@@ -50,10 +50,8 @@ AP_DECLARE(apr_status_t) ap_cookie_write(request_rec * r, const char *name, cons
     }
 
     /* 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_write2(request_rec * r, const char *name2, co
     }
 
     /* 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);