Bug #34608

ResourceStreamWrapper::seek gives exactly the wrong bool value

Added by Ferdinand Kuhl over 3 years ago. Updated over 3 years ago.

Status:Resolved Start date:2012-03-06
Priority:Must have Due date:
Assigned To:- % Done:

100%

Category:Resource
Target version:TYPO3 Flow Base Distribution - 1.0.4
PHP Version:5.3 Complexity:
Has patch:No Affected Flow version:Git master

Description

The ResourceStreamWrapper does:

return fseek($this->handle, $offset, $whence);

The documentation to fseek says:

Upon success, returns 0; otherwise, returns -1.

But PHP evaluates 0 to FALSE and -1 to TRUE. So the return value is always wrong. :(

Associated revisions

Revision dd761bb0
Added by Ferdinand Kuhl over 3 years ago

[BUGFIX] ResourceStreamWrapper returns wrong value for fseek

Calling fseek will always return the wrong value, as fseek
return 0 on success otherwise -1.
The stream_wrapper expects a boolean value. So 0 will be
evaluated to false and -1 will be evaluated to true

Change-Id: Ia1504b93acda83ca8f7378dc09dea2889c76a82d
Fixes: #34608
Releases: 1.0, 1.1

Revision 461bb056
Added by Ferdinand Kuhl over 3 years ago

[BUGFIX] ResourceStreamWrapper returns wrong value for fseek

Calling fseek will always return the wrong value, as fseek
return 0 on success otherwise -1.
The stream_wrapper expects a boolean value. So 0 will be
evaluated to false and -1 will be evaluated to true

Change-Id: I04d7b61b83f082ca99e071b6edd1bda866a25d76
Fixes: #34608
Releases: 1.0, 1.1

History

#1 Updated by Gerrit Code Review over 3 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9427

#2 Updated by Gerrit Code Review over 3 years ago

Patch set 1 for branch FLOW3-1.0 has been pushed to the review server.
It is available at http://review.typo3.org/9587

#3 Updated by Ferdinand Kuhl over 3 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF