format_drops_decimals = 1;
looks_numeric = /* Looks like *some* kind of number */
- is_plain_digit(buf[0]) ||
- (size > 1 && buf[0] == '-' && is_plain_digit(buf[1]));
+ is_plain_digit(buf[0]) || (size > 1 && buf[0] == '-' && is_plain_digit(buf[1]));
if (size < (int)sizeof(buf) - 2 && looks_numeric && !p && /* Has no decimal point */
strchr(buf, 'e') == NULL && /* Not scientific notation */
return NULL;
jso->len = len;
memcpy(jso->c_string.idata, s, len);
- jso->c_string.idata[len] = '\0';
+ // Cast below needed for Clang UB sanitizer
+ ((char *)jso->c_string.idata)[len] = '\0';
return &jso->base;
}
/* This handles the `json_type_null` case */
if (!iter.val)
jso = NULL;
- else if (json_object_deep_copy_recursive(iter.val, src, iter.key, UINT_MAX, &jso,
- shallow_copy) < 0)
+ else if (json_object_deep_copy_recursive(iter.val, src, iter.key, UINT_MAX,
+ &jso, shallow_copy) < 0)
{
json_object_put(jso);
return -1;
#endif
}
- return hashlittle((const char *)k, strlen((const char *)k), random_seed);
+ return hashlittle((const char *)k, strlen((const char *)k), (uint32_t)random_seed);
}
int lh_char_equal(const void *k1, const void *k2)