mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[11305] more safe code in vmaps and Field class
Signed-off-by: Ambal <pogrebniak@gala.net>
This commit is contained in:
parent
1fea8a321f
commit
43db4eaaa2
5 changed files with 10 additions and 13 deletions
|
|
@ -56,14 +56,11 @@ class Field
|
|||
uint32 GetUInt32() const { return mValue ? static_cast<uint32>(atol(mValue)) : uint32(0); }
|
||||
uint64 GetUInt64() const
|
||||
{
|
||||
if(mValue)
|
||||
{
|
||||
uint64 value;
|
||||
sscanf(mValue,UI64FMTD,&value);
|
||||
return value;
|
||||
}
|
||||
else
|
||||
uint64 value = 0;
|
||||
if(!mValue || sscanf(mValue,UI64FMTD,&value) == -1)
|
||||
return 0;
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
void SetType(enum DataTypes type) { mType = type; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue