changed strtod to strtol

This commit is contained in:
Timothe FRIGNAC 2017-08-31 15:14:31 +02:00
parent 3a1ab54ff0
commit d3362a238e

View file

@ -236,7 +236,7 @@ static int parse_tiles_specification(const char* const arg, int32_t * const ntil
static int parse_uint8(const char *numstr,uint8_t* number,int min, int max) static int parse_uint8(const char *numstr,uint8_t* number,int min, int max)
{ {
char *tail; char *tail;
int d = strtod(numstr, &tail); int d = strtol(numstr, &tail, 10);
if (*tail || d < min || d > max){ if (*tail || d < min || d > max){
fprintf(stderr, "Expected number between %d and %d\n", min, max); fprintf(stderr, "Expected number between %d and %d\n", min, max);
if(number) if(number)