hdtest: Only show "**DEALLOCATED**" for NULL value but positive length
This commit is contained in:
parent
e955598923
commit
c242150092
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
static void dump_val(json_t *jent, const char *key, uint8_t *val, size_t len)
|
static void dump_val(json_t *jent, const char *key, uint8_t *val, size_t len)
|
||||||
{
|
{
|
||||||
if(val == NULL) {
|
if(val == NULL && len > 0) {
|
||||||
json_object_set_new(jent, key, json_string("**DEALLOCATED**"));
|
json_object_set_new(jent, key, json_string("**DEALLOCATED**"));
|
||||||
} else {
|
} else {
|
||||||
json_object_set_new(jent, key, json_pack("s#", val, len));
|
json_object_set_new(jent, key, json_pack("s#", val, len));
|
||||||
|
|
Loading…
Reference in New Issue