On a 64-bit arch, we still want to make sure it's a 32-bit value. Gcc is
too smart for us to just cast; it will still warn on 32-bit arch that the
comparison is always true.
Signed-off-by: Sage Weil <sage@inktank.com>
if ((obj = iter.get_next())) {
char *end = NULL;
- unsigned long ul = strtoul(obj->get_data().c_str(), &end, 10);
- if (ul == ULONG_MAX || ul >= 0x100000000LL) {
+ unsigned long long ull = strtoull(obj->get_data().c_str(), &end, 10);
+ if (ull >= 0x100000000ull) {
max_age = CORS_MAX_AGE_INVALID;
} else {
- max_age = (uint32_t)ul;
+ max_age = (uint32_t)ull;
}
dout(10) << "RGWCORSRule : max_age : " << max_age << dendl;
}