Skip to content

Commit 8fa61ed

Browse files
committed
Review fixes
1 parent 6587c46 commit 8fa61ed

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
@@ -625,19 +625,23 @@ PHP_FUNCTION(oci_lob_erase)
625625
zval *tmp, *z_descriptor;
626626
php_oci_descriptor *descriptor;
627627
ub4 bytes_erased;
628-
zend_long offset = -1, length = -1;
628+
zend_long offset, length;
629629
zend_bool offset_is_null = 1, length_is_null = 1;
630630

631631
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) {
632632
RETURN_THROWS();
633633
}
634634

635-
if (!offset_is_null && offset < 0) {
635+
if (offset_is_null) {
636+
offset = -1;
637+
} else if (offset < 0) {
636638
php_error_docref(NULL, E_WARNING, "Offset must be greater than or equal to 0");
637639
RETURN_FALSE;
638640
}
639641

640-
if (!length_is_null && length < 0) {
642+
if (length_is_null) {
643+
length = -1;
644+
else if (length < 0) {
641645
php_error_docref(NULL, E_WARNING, "Length must be greater than or equal to 0");
642646
RETURN_FALSE;
643647
}

0 commit comments

Comments
 (0)