mystrtoi and mystrtoll did not round correctly for negative numbers,
this was fixed.
double temp_res;
char *start = *p;
temp_res = strtod(*p, p);
- *res = (int) (temp_res + 0.5);
+ *res = (int) (temp_res + (temp_res > 0 ? 0.5 : -0.5));
if (*p != start)
return 1;
else
double temp_res;
char *start = *p;
temp_res = strtod(*p, p);
- *res = (long long) (temp_res + 0.5);
+ *res = (int) (temp_res + (temp_res > 0 ? 0.5 : -0.5));
if (*p != start)
return 1;
else