Fix string_equal() for strings of unequal length.

This commit is contained in:
Dag-Erling Smørgrav 2014-12-29 12:46:44 +00:00 committed by des
parent 2ad45cfccf
commit 79967f2844

View file

@ -309,5 +309,5 @@ string_equal(const string *s1, const string *s2)
for (p1 = s1->buf, p2 = s2->buf; *p1 && *p2; ++p1, ++p2) for (p1 = s1->buf, p2 = s2->buf; *p1 && *p2; ++p1, ++p2)
if (*p1 != *p2) if (*p1 != *p2)
return (0); return (0);
return (1); return (*p1 || *p2 ? 0 : 1);
} }