Displaying 1 result from an estimated 1 matches for "scale_length".
2013 Jan 08
0
[PATCH] avoid undefined behavior in fmt_scaled()
...= ERANGE;
+ return -1;
+ }
+
abval = (number < 0LL) ? -number : number; /* no long long_abs yet */
- /* Not every negative long long has a positive representation.
- * Also check for numbers that are just too darned big to format
- */
- if (abval < 0 || abval / 1024 >= scale_factors[SCALE_LENGTH-1]) {
+ /* Check for numbers that are just too darned big to format. */
+ if (abval / 1024 >= scale_factors[SCALE_LENGTH-1]) {
errno = ERANGE;
return -1;
}