From: Stefan Fritsch Date: Tue, 3 Aug 2010 22:06:24 +0000 (+0000) Subject: remove more useless use of strlen X-Git-Tag: 2.3.7~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b3189cb8dff0f9a030a9fd1c01486ce35c78caf;p=thirdparty%2Fapache%2Fhttpd.git remove more useless use of strlen git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@982046 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/proxy/mod_proxy_balancer.c b/modules/proxy/mod_proxy_balancer.c index a2af29d93a8..444ce64e694 100644 --- a/modules/proxy/mod_proxy_balancer.c +++ b/modules/proxy/mod_proxy_balancer.c @@ -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; diff --git a/server/util_cookies.c b/server/util_cookies.c index 5e00fc6c5fc..3b3c9523827 100644 --- a/server/util_cookies.c +++ b/server/util_cookies.c @@ -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);