Fix decimal parser skipping first digit

This commit is contained in:
Cubitect 2021-12-08 20:02:42 +01:00
parent 9bdc83b6ed
commit d81832c670

2
util.c
View File

@ -354,7 +354,7 @@ int parseBiomeColors(unsigned char biomeColors[256][3], const char *buf)
if (ic < 4 && (*p == '#' || (p[0] == '0' && p[1] == 'x')))
col[ic++] = strtol(p+1+(*p=='0'), (char**)&p, 16);
else if (ic < 4 && *p >= '0' && *p <= '9')
col[ic++] = strtol(p+1, (char**)&p, 10);
col[ic++] = strtol(p, (char**)&p, 10);
if (*p == '\n')
break;
}