Skip to content

Commit

Permalink
Remove the math
Browse files Browse the repository at this point in the history
Signed-off-by: Sourav Moitra <[email protected]>
  • Loading branch information
xw19 committed Jan 1, 2025
1 parent bfc8fca commit e51417c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion src/ocispec/json_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ json_double_to_uint64 (double d, uint64_t *converted)
// Safely convert double to uint64_t by checking for potential overflows
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[24];
char string[20];
sprintf(string, "%0.f", d);
*converted = strtoull(string, NULL, 10);
} else {
Expand Down
1 change: 0 additions & 1 deletion src/ocispec/json_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <string.h>
#include <stdint.h>
#include <jansson.h>
#include <math.h>

#ifdef __cplusplus
extern "C" {
Expand Down

0 comments on commit e51417c

Please sign in to comment.