mirror of https://github.com/xzeldon/htop.git
Hashtable: fix handling of NULL pointer in Hashtable_dump
This fixes an issus in Hashtable_dump where `"(nil"` is passed as an argument to `%p` in fprintf. This prints the static address of `"(nil)"` not "(nil)". This commit changes the code to just pass the NULL pointer to fprintf, which will consistently print "0x0".
This commit is contained in:
parent
4b8b61fe18
commit
0388b30077
|
@ -52,7 +52,7 @@ static void Hashtable_dump(const Hashtable* this) {
|
|||
i,
|
||||
this->buckets[i].key,
|
||||
this->buckets[i].probe,
|
||||
this->buckets[i].value ? (const void*)this->buckets[i].value : "(nil)");
|
||||
this->buckets[i].value);
|
||||
|
||||
if (this->buckets[i].value)
|
||||
items++;
|
||||
|
|
Loading…
Reference in New Issue