Skip to content

Commit

Permalink
Try again
Browse files Browse the repository at this point in the history
Signed-off-by: Sourav Moitra <sourav.moitr@gmail.com>
  • Loading branch information
xw19 committed Jan 1, 2025
1 parent 7fc2991 commit f86d97f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ocispec/json_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ int
json_double_to_uint64 (double d, uint64_t *converted)
{
// Safely convert double to uint64_t by checking for potential overflows
if (d >= 9223372036854775807.0) { // Check if value is greater than or equal to 2^32
if (d >= 4294967296.0) { // Check if value is greater than or equal to 2^32
// TODO: Better solution for converting double to uint64
char string[20];
char string[24];
sprintf(string, "%0.f", d);
*converted = strtoull(string, NULL, 10);
} else {
Expand Down

0 comments on commit f86d97f

Please sign in to comment.