Commit 6c8747b1 by Richard Stallman

(compare_strings): Check for null pointers.

From-SVN: r6014
parent c35a847e
...@@ -193,7 +193,12 @@ compare_ptrs (const void *k1, const void *k2) ...@@ -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);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment