[11305] more safe code in vmaps and Field class

Signed-off-by: Ambal <pogrebniak@gala.net>
This commit is contained in:
Ambal 2011-04-02 17:30:17 +03:00
parent 1fea8a321f
commit 43db4eaaa2
5 changed files with 10 additions and 13 deletions

View file

@ -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; }