From 792a71552f596c4e88eb394b4a174f5490184a67 Mon Sep 17 00:00:00 2001 From: "rpotts%netscape.com" Date: Thu, 8 Jul 1999 23:34:25 +0000 Subject: [PATCH] Added code to initialize amt (in case it is not zeroed out in the failure case) git-svn-id: svn://10.0.0.236/trunk@38832 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/io/nsPipe.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mozilla/xpcom/io/nsPipe.cpp b/mozilla/xpcom/io/nsPipe.cpp index 170c0e35f86..2fd80a183bc 100644 --- a/mozilla/xpcom/io/nsPipe.cpp +++ b/mozilla/xpcom/io/nsPipe.cpp @@ -169,6 +169,8 @@ nsBufferInputStream::Read(char* aBuf, PRUint32 aCount, PRUint32 *aReadCount) *aReadCount = 0; while (aCount > 0) { PRUint32 amt; + + amt = 0; rv = mBuffer->Read(aBuf, aCount, &amt); if (rv == NS_BASE_STREAM_EOF) { rv = (*aReadCount == 0) ? rv : NS_OK; @@ -241,6 +243,7 @@ nsBufferInputStream::Fill(const char* aBuf, PRUint32 aCount, PRUint32 *aWriteCou *aWriteCount = 0; while (aCount > 0) { PRUint32 amt; + amt = 0; rv = mBuffer->Write(aBuf, aCount, &amt); if (rv == NS_BASE_STREAM_EOF) return *aWriteCount > 0 ? NS_OK : rv; @@ -277,6 +280,7 @@ nsBufferInputStream::FillFrom(nsIInputStream *fromStream, PRUint32 aCount, PRUin *aWriteCount = 0; while (aCount > 0) { PRUint32 amt; + amt = 0; rv = mBuffer->WriteFrom(fromStream, aCount, &amt); if (rv == NS_BASE_STREAM_EOF) return *aWriteCount > 0 ? NS_OK : rv; @@ -453,6 +457,7 @@ nsBufferOutputStream::WriteFrom(nsIInputStream* fromStream, PRUint32 aCount, *aWriteCount = 0; while (aCount > 0) { PRUint32 amt; + amt = 0; rv = mBuffer->WriteFrom(fromStream, aCount, &amt); // if (rv == NS_BASE_STREAM_WOULD_BLOCK) break; // If a blocking write fails just drop into Flush(...)