Index: src/core/SkOrderedReadBuffer.cpp |
diff --git a/src/core/SkOrderedReadBuffer.cpp b/src/core/SkOrderedReadBuffer.cpp |
index 4af64706a1db70e9246863a75f1ef9d183982c11..560b5b68648b87c2ed35e5bd71af8e5279250f72 100644 |
--- a/src/core/SkOrderedReadBuffer.cpp |
+++ b/src/core/SkOrderedReadBuffer.cpp |
@@ -88,12 +88,10 @@ int32_t SkOrderedReadBuffer::read32() { |
return fReader.readInt(); |
} |
-char* SkOrderedReadBuffer::readString() { |
- const char* string = fReader.readString(); |
- const size_t length = strlen(string); |
- char* value = (char*)sk_malloc_throw(length + 1); |
- strcpy(value, string); |
- return value; |
+void SkOrderedReadBuffer::readString(SkString* string) { |
+ size_t len; |
+ const char* strContents = fReader.readString(&len); |
+ string->set(strContents, len); |
} |
void* SkOrderedReadBuffer::readEncodedString(size_t* length, SkPaint::TextEncoding encoding) { |