Correctly handle leading zeros for numbers

master
teknomunk 1 year ago
parent f035a0e7f9
commit 9b1a1397a4

@ -13,7 +13,15 @@ void qf_string( void* ptr, const char* value )
void qf_integer( void* ptr, const char* value )
{
if( value ) {
*(int*)ptr = atoi(value);
// Skip any zeros
while( *value == '0' ) { ++value; }
printf( "value=%s\n", value );
int res = 0;
if( 1 == sscanf( value, "%d", &res ) ) {
*(int*)ptr = res;
}
//*(int*)ptr = atoi(value);
}
}
void qf_bool( void* ptr, const char* value )

Loading…
Cancel
Save