Skip to content

Commit 9e309a2

Browse files
committed
fix php_stream_copy_to_stream_ex usage
1 parent a7f0465 commit 9e309a2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ext/dba/libinifile/inifile.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ static int inifile_copy_to(inifile *dba, size_t pos_start, size_t pos_end, inifi
402402
return FAILURE;
403403
}
404404
php_stream_seek(dba->fp, pos_start, SEEK_SET);
405-
if (!php_stream_copy_to_stream_ex(dba->fp, fp, pos_end - pos_start, NULL)) {
405+
if (SUCCESS != php_stream_copy_to_stream_ex(dba->fp, fp, pos_end - pos_start, NULL)) {
406406
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy group [%zu - %zu] to temporary stream", pos_start, pos_end);
407407
return FAILURE;
408408
}
@@ -427,7 +427,7 @@ static int inifile_filter(inifile *dba, inifile *from, const key_type *key TSRML
427427
pos_curr = php_stream_tell(from->fp);
428428
if (pos_start != pos_next) {
429429
php_stream_seek(from->fp, pos_start, SEEK_SET);
430-
if (!php_stream_copy_to_stream_ex(from->fp, dba->fp, pos_next - pos_start, NULL)) {
430+
if (SUCCESS != php_stream_copy_to_stream_ex(from->fp, dba->fp, pos_next - pos_start, NULL)) {
431431
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy [%zu - %zu] from temporary stream", pos_next, pos_start);
432432
ret = FAILURE;
433433
}
@@ -446,7 +446,7 @@ static int inifile_filter(inifile *dba, inifile *from, const key_type *key TSRML
446446
}
447447
if (pos_start != pos_next) {
448448
php_stream_seek(from->fp, pos_start, SEEK_SET);
449-
if (!php_stream_copy_to_stream_ex(from->fp, dba->fp, pos_next - pos_start, NULL)) {
449+
if (SUCCESS != php_stream_copy_to_stream_ex(from->fp, dba->fp, pos_next - pos_start, NULL)) {
450450
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy [%zu - %zu] from temporary stream", pos_next, pos_start);
451451
ret = FAILURE;
452452
}
@@ -497,7 +497,7 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons
497497
php_stream_seek(dba->fp, 0, SEEK_END);
498498
if (pos_grp_next != (size_t)php_stream_tell(dba->fp)) {
499499
php_stream_seek(dba->fp, pos_grp_next, SEEK_SET);
500-
if (!php_stream_copy_to_stream_ex(dba->fp, fp_tmp, PHP_STREAM_COPY_ALL, NULL)) {
500+
if (SUCCESS != php_stream_copy_to_stream_ex(dba->fp, fp_tmp, PHP_STREAM_COPY_ALL, NULL)) {
501501
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy remainder to temporary stream");
502502
ret = FAILURE;
503503
}
@@ -538,7 +538,7 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons
538538
if (fp_tmp && php_stream_tell(fp_tmp)) {
539539
php_stream_seek(fp_tmp, 0, SEEK_SET);
540540
php_stream_seek(dba->fp, 0, SEEK_END);
541-
if (!php_stream_copy_to_stream_ex(fp_tmp, dba->fp, PHP_STREAM_COPY_ALL, NULL)) {
541+
if (SUCCESS != php_stream_copy_to_stream_ex(fp_tmp, dba->fp, PHP_STREAM_COPY_ALL, NULL)) {
542542
php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Could not copy from temporary stream - ini file truncated");
543543
ret = FAILURE;
544544
}

0 commit comments

Comments
 (0)