Skip to content

Commit bbeee5a

Browse files
committed
Review fixes
1 parent 8d52248 commit bbeee5a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

ext/oci8/oci8_interface.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -630,19 +630,23 @@ PHP_FUNCTION(oci_lob_erase)
630630
zval *tmp, *z_descriptor;
631631
php_oci_descriptor *descriptor;
632632
ub4 bytes_erased;
633-
zend_long offset = -1, length = -1;
633+
zend_long offset, length;
634634
zend_bool offset_is_null = 1, length_is_null = 1;
635635

636636
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|l!l!", &z_descriptor, oci_lob_class_entry_ptr, &offset, &offset_is_null, &length, &length_is_null) == FAILURE) {
637637
RETURN_THROWS();
638638
}
639639

640-
if (!offset_is_null && offset < 0) {
640+
if (offset_is_null) {
641+
offset = -1;
642+
} else if (offset < 0) {
641643
php_error_docref(NULL, E_WARNING, "Offset must be greater than or equal to 0");
642644
RETURN_FALSE;
643645
}
644646

645-
if (!length_is_null && length < 0) {
647+
if (length_is_null) {
648+
length = -1;
649+
} else if (length < 0) {
646650
php_error_docref(NULL, E_WARNING, "Length must be greater than or equal to 0");
647651
RETURN_FALSE;
648652
}

0 commit comments

Comments
 (0)