[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-cvs
Subject:    [PHP-CVS] com php-src: Add parenthesis to if statements: ext/ldap/ldap.c
From:       Côme Bernigaud <mcmic () php ! net>
Date:       2016-06-29 12:37:48
Message-ID: php-mail-85bd0dc8a07b582aff98465b29b716d64314611 () git ! php ! net
[Download RAW message or body]

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];


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic