From fd59d1200073604c0a5dafe14edbb6f3833e1c3d Mon Sep 17 00:00:00 2001 From: "reed@google.com" Date: Mon, 2 Jul 2012 20:28:31 +0000 Subject: change NewWithCString to allocate room for the terminating NULL, so the data can be treated as a cstring (duh). git-svn-id: http://skia.googlecode.com/svn/trunk@4430 2bbb7eff-a529-9590-31e7-b0007b416f81 --- include/core/SkData.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include/core') diff --git a/include/core/SkData.h b/include/core/SkData.h index f24cf9c92c..61b52c5480 100644 --- a/include/core/SkData.h +++ b/include/core/SkData.h @@ -69,7 +69,9 @@ public: /** * Create a new dataref by copying the specified c-string - * (a null-terminated array of bytes). + * (a null-terminated array of bytes). The returned SkData will have size() + * equal to strlen(cstr) + 1. If cstr is NULL, it will be treated the same + * as "". */ static SkData* NewWithCString(const char cstr[]); -- cgit v1.2.3