字节数组的拷贝函数比较容易出错,要非常小心

This commit is contained in:
nnhy 2015-10-26 02:44:31 +00:00
parent 7704197ae6
commit f6ba581a28
1 changed files with 1 additions and 1 deletions

View File

@ -189,7 +189,7 @@ bool Config::Get(const char* name, ByteArray& bs)
const ConfigBlock* cfg = (const ConfigBlock*)Find(name, 0);
if(cfg && cfg->Size > 0 && cfg->Size <= bs.Capacity())
{
bs.Copy(cfg->Data(), 0, cfg->Size);
bs.Copy(cfg->Data(), cfg->Size);
bs.SetLength(cfg->Size);
return true;