diff options
| author | Eitan Adler <eadler@FreeBSD.org> | 2011-11-22 00:07:53 +0000 |
|---|---|---|
| committer | Eitan Adler <eadler@FreeBSD.org> | 2011-11-22 00:07:53 +0000 |
| commit | 55e84fcee17fd2a584eeda2dfc8c3eac12b0c234 (patch) | |
| tree | abcaedad17a9a120ce91c83c2e7ca0fda8f47c2d /lib/libc/string/strcmp.c | |
| parent | a54626e0cd898be4e2c28851d576cd5639473c19 (diff) | |
Notes
Diffstat (limited to 'lib/libc/string/strcmp.c')
| -rw-r--r-- | lib/libc/string/strcmp.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/libc/string/strcmp.c b/lib/libc/string/strcmp.c index 95c778dc2296..70fd22d6fa62 100644 --- a/lib/libc/string/strcmp.c +++ b/lib/libc/string/strcmp.c @@ -44,6 +44,9 @@ __FBSDID("$FreeBSD$"); int strcmp(const char *s1, const char *s2) { + if (s1 == s2) + return (0); + while (*s1 == *s2++) if (*s1++ == '\0') return (0); |
