Index: tests/StreamTest.cpp |
diff --git a/tests/StreamTest.cpp b/tests/StreamTest.cpp |
index 08adf142c10313bb0f1b4983556db9ec025387a4..6f78eca5f0de6c4554db514ccad9c0fbb9138e38 100644 |
--- a/tests/StreamTest.cpp |
+++ b/tests/StreamTest.cpp |
@@ -343,15 +343,15 @@ public: |
DumbStream(const uint8_t* data, size_t n) |
: fData(data), fCount(n), fIdx(0) {} |
size_t read(void* buffer, size_t size) override { |
- size_t c = SkTMin(fCount - fIdx, size); |
- if (c) { |
- memcpy(buffer, &fData[fIdx], size); |
- fIdx += c; |
+ size_t copyCount = SkTMin(fCount - fIdx, size); |
+ if (copyCount) { |
+ memcpy(buffer, &fData[fIdx], copyCount); |
+ fIdx += copyCount; |
} |
- return c; |
+ return copyCount; |
} |
bool isAtEnd() const override { |
- return fCount > fIdx; |
+ return fCount == fIdx; |
} |
private: |
const uint8_t* fData; |