From e95be546f12c8ec89119dfb7a9b2a3c67c5dabf8 Mon Sep 17 00:00:00 2001 From: xPaw Date: Sun, 5 Jul 2015 18:35:23 +0300 Subject: [PATCH] Trim NUL bytes from rcon output, fixes #51 --- SourceQuery/SourceRcon.class.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/SourceQuery/SourceRcon.class.php b/SourceQuery/SourceRcon.class.php index 4e07a4c..1bfaab6 100644 --- a/SourceQuery/SourceRcon.class.php +++ b/SourceQuery/SourceRcon.class.php @@ -162,9 +162,7 @@ while( true ); } - // TODO: It should use GetString, but there are no null bytes at the end, why? - // $Buffer = $this->Buffer->GetString( ); - return $Buffer; + return rtrim( $Buffer, "\0" ); } public function Authorize( $Password )