Skip to content

Commit d7f946d

Browse files
committed
ext/ldap: Use bool instead of int
1 parent f604878 commit d7f946d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

ext/ldap/ldap.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,6 @@ static int _php_ldap_control_from_array(LDAP *ld, LDAPControl** ctrl, zval* arra
410410
{
411411
zval* val;
412412
zend_string *control_oid;
413-
int control_iscritical = 0, rc = LDAP_SUCCESS;
414413
char** ldap_attrs = NULL;
415414
LDAPSortKey** sort_keys = NULL;
416415
zend_string *tmpstring = NULL, **tmpstrings1 = NULL, **tmpstrings2 = NULL;
@@ -426,15 +425,15 @@ static int _php_ldap_control_from_array(LDAP *ld, LDAPControl** ctrl, zval* arra
426425
return -1;
427426
}
428427

428+
bool control_iscritical = false;
429429
if ((val = zend_hash_str_find(Z_ARRVAL_P(array), "iscritical", sizeof("iscritical") - 1)) != NULL) {
430430
control_iscritical = zend_is_true(val);
431-
} else {
432-
control_iscritical = 0;
433431
}
434432

435433
BerElement *ber = NULL;
436434
struct berval control_value = { 0L, NULL };
437-
int control_value_alloc = 0;
435+
bool control_value_alloc = false;
436+
int rc = LDAP_SUCCESS;
438437

439438
if ((val = zend_hash_find(Z_ARRVAL_P(array), ZSTR_KNOWN(ZEND_STR_VALUE))) != NULL) {
440439
if (Z_TYPE_P(val) != IS_ARRAY) {

0 commit comments

Comments
 (0)