diff --git a/include/json_print.h b/include/json_print.h index 78a6c83f..218da31a 100644 --- a/include/json_print.h +++ b/include/json_print.h @@ -66,7 +66,7 @@ _PRINT_FUNC(uint, unsigned int); _PRINT_FUNC(u64, uint64_t); _PRINT_FUNC(hu, unsigned short); _PRINT_FUNC(hex, unsigned int); -_PRINT_FUNC(0xhex, unsigned int); +_PRINT_FUNC(0xhex, unsigned long long int); _PRINT_FUNC(luint, unsigned long int); _PRINT_FUNC(lluint, unsigned long long int); _PRINT_FUNC(float, double); diff --git a/lib/json_print.c b/lib/json_print.c index eed109c5..f7ef41c1 100644 --- a/lib/json_print.c +++ b/lib/json_print.c @@ -172,12 +172,12 @@ void print_color_0xhex(enum output_type type, enum color_attr color, const char *key, const char *fmt, - unsigned int hex) + unsigned long long hex) { if (_IS_JSON_CONTEXT(type)) { SPRINT_BUF(b1); - snprintf(b1, sizeof(b1), "%#x", hex); + snprintf(b1, sizeof(b1), "%#llx", hex); print_string(PRINT_JSON, key, NULL, b1); } else if (_IS_FP_CONTEXT(type)) { color_fprintf(stdout, color, fmt, hex);