Skip to content

Commit ee9d879

Browse files
committed
Fix error condition
1 parent 8827cc3 commit ee9d879

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

main/streams/plain_wrapper.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -872,13 +872,13 @@ static int php_stdiop_set_option(php_stream *stream, int option, int value, void
872872
sz.HighPart = 0;
873873
sz.LowPart = new_size;
874874
#endif
875-
if (INVALID_SET_FILE_POINTER == SetFilePointerEx(h, sz, NULL, FILE_BEGIN) && NO_ERROR != GetLastError()) {
875+
if (!SetFilePointerEx(h, sz, NULL, FILE_BEGIN)) {
876876
return PHP_STREAM_OPTION_RETURN_ERR;
877877
}
878878
if (0 == SetEndOfFile(h)) {
879879
return PHP_STREAM_OPTION_RETURN_ERR;
880880
}
881-
if (INVALID_SET_FILE_POINTER == SetFilePointerEx(h, old_sz, NULL, FILE_BEGIN) && NO_ERROR != GetLastError()) {
881+
if (!SetFilePointerEx(h, old_sz, NULL, FILE_BEGIN)) {
882882
return PHP_STREAM_OPTION_RETURN_ERR;
883883
}
884884
return PHP_STREAM_OPTION_RETURN_OK;

0 commit comments

Comments
 (0)