improve value_str_ex

This commit is contained in:
lixianjing 2021-01-04 10:44:00 +08:00
parent df045810db
commit 3d7fd22087

View File

@ -763,6 +763,10 @@ const char* value_str_ex(const value_t* v, char* buff, uint32_t size) {
} else if (v->type == VALUE_TYPE_UINT8 || v->type == VALUE_TYPE_UINT16 ||
v->type == VALUE_TYPE_UINT32) {
tk_snprintf(buff, size, "%u", value_uint32(v));
} else if (v->type == VALUE_TYPE_UINT64) {
tk_snprintf(buff, size, "%llu", value_uint64(v));
} else if (v->type == VALUE_TYPE_INT64) {
tk_snprintf(buff, size, "%lld", value_uint64(v));
} else {
tk_snprintf(buff, size, "%d", value_int(v));
}