Skip to content

Commit

Permalink
Update SSDB.php, check fwrite return with ===
Browse files Browse the repository at this point in the history
  • Loading branch information
ideawu committed Dec 5, 2014
1 parent fd6e38b commit 7cb705b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/php/SSDB.php
Expand Up @@ -499,7 +499,7 @@ private function send($data){
try{
while(true){
$ret = @fwrite($this->sock, $s);
if($ret == false){
if($ret === false){
$this->close();
throw new SSDBException('Connection lost');
}
Expand Down

1 comment on commit 7cb705b

@ideawu
Copy link
Owner Author

@ideawu ideawu commented on 7cb705b May 31, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, never check fwrite with ===, or you must check with === 0 at the same time

Please sign in to comment.