Browse Source

Fix plStringBuffer constructor with explicit size to count chars, not bytes

Michael Hansen 11 years ago
parent
commit
9771baf7dd
  1. 2
      Sources/Plasma/CoreLib/plString.h

2
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())

Loading…
Cancel
Save