Commit 0f8b7b74 authored by Mai Shimozato's avatar Mai Shimozato Committed by Daniel DeGrasse
Browse files

stdlib : strtoll : fix strtoll overflow handling with unsigned accumulator



ensure correct assignment of overflow values to unsigned accumulator

Signed-off-by: default avatarMai Shimozato <mshimozato@tenstorrent.com>
parent aa8b2591
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -114,7 +114,11 @@ long long strtoll(const char *nptr, char **endptr, register int base)
	}

	if (any < 0) {
		acc = neg ? LLONG_MIN : LLONG_MAX;
		if (neg) {
			acc = (unsigned long long)(-(LLONG_MIN + 1)) + 1;
		} else {
			acc = LLONG_MAX;
		}
		errno = ERANGE;
	} else if (neg) {
		acc = -acc;