summaryrefslogtreecommitdiff
path: root/ext/ldap
diff options
context:
space:
mode:
authorGeorge Peter Banyard <girgias@php.net>2020-02-06 13:20:15 +0100
committerGeorge Peter Banyard <girgias@php.net>2020-02-06 13:20:15 +0100
commitc3e65d90690be1ad201c05d5b635a41479c9e8a0 (patch)
treeb13f2b9aedade26c678da33ceb99524d31e811dd /ext/ldap
parentd4de3f95d606b9e780e27d2b877a9e60aeccd134 (diff)
downloadphp-git-c3e65d90690be1ad201c05d5b635a41479c9e8a0.tar.gz
Fix [-Wtype-limits] warning in LDAP by removing unnecessary condition
As context is a pointer to a berval struct and bv_len is of type ber_len_t [1] which it self is defined as an unsigned integer [2] this condition is always true. [1] https://www.openldap.org/devel/gitweb.cgi?p=openldap.git;a=blob;f=include/lber.h#l212 [2] https://www.openldap.org/software//man.cgi?query=ber_free&sektion=3&apropos=0&manpath=OpenLDAP+2.4-Release
Diffstat (limited to 'ext/ldap')
-rw-r--r--ext/ldap/ldap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c
index 728dd588d9..a5bbc68238 100644
--- a/ext/ldap/ldap.c
+++ b/ext/ldap/ldap.c
@@ -257,7 +257,7 @@ static void _php_ldap_control_to_array(LDAP *ld, LDAPControl* ctrl, zval* array,
add_assoc_long(&value, "target", target);
add_assoc_long(&value, "count", count);
add_assoc_long(&value, "errcode", errcode);
- if ( context && (context->bv_len >= 0) ) {
+ if (context) {
add_assoc_stringl(&value, "context", context->bv_val, context->bv_len);
}
add_assoc_zval(array, "value", &value);