From 9771baf7ddf7e883f9377c5c426f6077688766ed Mon Sep 17 00:00:00 2001 From: Michael Hansen Date: Sun, 1 Jun 2014 13:01:06 -0700 Subject: [PATCH] Fix plStringBuffer constructor with explicit size to count chars, not bytes --- Sources/Plasma/CoreLib/plString.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Plasma/CoreLib/plString.h b/Sources/Plasma/CoreLib/plString.h index 50092da0..299ffa64 100644 --- a/Sources/Plasma/CoreLib/plString.h +++ b/Sources/Plasma/CoreLib/plString.h @@ -137,7 +137,7 @@ public: { memset(fShort, 0, sizeof(fShort)); _Ch *copyData = IHaveACow() ? new _Ch[size + 1] : fShort; - memcpy(copyData, data, size); + memcpy(copyData, data, size * sizeof(_Ch)); copyData[size] = 0; if (IHaveACow())