mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-06 14:44:26 +00:00
Fixed bug where extra garbage was being read from the stream...
This commit is contained in:
parent
5e732d9a66
commit
d8a7ec1cda
@ -217,13 +217,15 @@ InputTestConsumer::OnDataAvailable(nsISupports* context,
|
||||
{
|
||||
char buf[1025];
|
||||
PRUint32 amt;
|
||||
while (PR_TRUE) {
|
||||
nsresult rv = aIStream->Read(buf, 1024, &amt);
|
||||
nsresult rv;
|
||||
|
||||
do {
|
||||
rv = aIStream->Read(buf, 1024, &amt);
|
||||
if (rv == NS_BASE_STREAM_EOF) break;
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
buf[amt] = '\0';
|
||||
puts(buf);
|
||||
};
|
||||
} while (amt);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user