Skip to content

Commit b170daf

Browse files
PatriceJiangminggo
authored andcommitted
fix wrong parameter (cocos2d#19060)
1 parent 53bed4f commit b170daf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cocos/base/CCData.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ ssize_t Data::copy(const unsigned char* bytes, const ssize_t size)
116116
if (bytes != _bytes)
117117
{
118118
clear();
119-
_bytes = (unsigned char*)malloc(sizeof(unsigned char) * _size);
120-
memcpy(_bytes, bytes, _size);
119+
_bytes = (unsigned char*)malloc(sizeof(unsigned char) * size);
120+
memcpy(_bytes, bytes, size);
121121
}
122122

123123
_size = size;

0 commit comments

Comments
 (0)