(compare_strings): Check for null pointers.
From-SVN: r6014
This commit is contained in:
parent
c35a847ec5
commit
6c8747b19a
@ -193,7 +193,12 @@ compare_ptrs (const void *k1, const void *k2)
|
|||||||
static inline int
|
static inline int
|
||||||
compare_strings (const void *k1, const void *k2)
|
compare_strings (const void *k1, const void *k2)
|
||||||
{
|
{
|
||||||
return !strcmp (k1, k2);
|
if (k1 == k2)
|
||||||
|
return 1;
|
||||||
|
else if (k1 == 0 || k2 == 0)
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
|
return !strcmp (k1, k2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user