Commit fbba7679 authored by Vitaly Lipatov's avatar Vitaly Lipatov

uni_atoi: use sscanf instead atoi

parent 5dbc7d69
......@@ -205,17 +205,14 @@ namespace UniSetTypes
long setoutregion(long raw, long rawMin, long rawMax);
/// ( 0x, 16-)
/// ( 0, 8-, 0x, 16-, . )
inline int uni_atoi( const char* str )
{
if ( str == NULL)
return 0;
if (strlen(str) < 3 || toupper(str[1]) != 'X')
return std::atoi(str);
unsigned int n;
std::sscanf(str,"%x",&n);
std::sscanf(str, "%i", &n);
return n;
}
inline int uni_atoi( const std::string str )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment