com php-src: Add parenthesis to if statements: ext/ldap/ldap.c

From: Date: Wed, 29 Jun 2016 12:37:48 +0000
Subject: com php-src: Add parenthesis to if statements: ext/ldap/ldap.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-92861@lists.php.net to get a copy of this message
Commit: b1d82607e6ce3ec30525a49844e914f7194f8b40 Author: Chad Sikorra <Chad.Sikorra@gmail.com> Wed, 29 Jun 2016 07:37:48 -0500 Parents: f910ca259f9be7dad7804eda19505490b4d5f132 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b1d82607e6ce3ec30525a49844e914f7194f8b40 Log: Add parenthesis to if statements Changed paths: M ext/ldap/ldap.c Diff: diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index 3b95286..3c67a56 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -2834,10 +2834,10 @@ static zend_string* php_ldap_do_escape(const zend_bool *map, const char *value, len += (map[(unsigned char) value[i]]) ? 3 : 1; } /* Per RFC 4514, a leading and trailing space must be escaped */ - if (flags & PHP_LDAP_ESCAPE_DN && value[0] == ' ') { + if ((flags & PHP_LDAP_ESCAPE_DN) && (value[0] == ' ')) { len += 2; } - if (flags & PHP_LDAP_ESCAPE_DN && valuelen > 1 && value[valuelen - 1] == ' ') { + if ((flags & PHP_LDAP_ESCAPE_DN) && ((valuelen > 1) && (value[valuelen - 1] == ' '))) { len += 2; } @@ -2846,7 +2846,7 @@ static zend_string* php_ldap_do_escape(const zend_bool *map, const char *value, for (i = 0; i < valuelen; i++) { unsigned char v = (unsigned char) value[i]; - if (map[v] || (flags & PHP_LDAP_ESCAPE_DN && (i == 0 || i + 1 == valuelen) && v == ' ')) { + if (map[v] || ((flags & PHP_LDAP_ESCAPE_DN) && ((i == 0) || (i + 1 == valuelen)) && (v == ' '))) { ZSTR_VAL(ret)[p++] = '\\'; ZSTR_VAL(ret)[p++] = hex[v >> 4]; ZSTR_VAL(ret)[p++] = hex[v & 0x0f];

« previous php.cvs (#92861) next »