Skip to content

Commit c3e65d9

Browse files
committed
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
1 parent d4de3f9 commit c3e65d9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/ldap/ldap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ static void _php_ldap_control_to_array(LDAP *ld, LDAPControl* ctrl, zval* array,
257257
add_assoc_long(&value, "target", target);
258258
add_assoc_long(&value, "count", count);
259259
add_assoc_long(&value, "errcode", errcode);
260-
if ( context && (context->bv_len >= 0) ) {
260+
if (context) {
261261
add_assoc_stringl(&value, "context", context->bv_val, context->bv_len);
262262
}
263263
add_assoc_zval(array, "value", &value);

0 commit comments

Comments
 (0)