summaryrefslogtreecommitdiffstats
path: root/lib/libc/string/memmem.c
diff options
context:
space:
mode:
authorajacoutot <ajacoutot@openbsd.org>2013-05-15 12:45:59 +0000
committerajacoutot <ajacoutot@openbsd.org>2013-05-15 12:45:59 +0000
commitc21a338fbccb3171603ad4aa5d8f60a2f17ec57a (patch)
tree7a29898db6857495d9abba3dc8bcbbeb560849a4 /lib/libc/string/memmem.c
parentsync the list of pre haswell intel video devices with linux (diff)
downloadwireguard-openbsd-c21a338fbccb3171603ad4aa5d8f60a2f17ec57a.tar.xz
wireguard-openbsd-c21a338fbccb3171603ad4aa5d8f60a2f17ec57a.zip
typo: compare len against null needle, not haystack
from Alf Schlichting ok millert@
Diffstat (limited to 'lib/libc/string/memmem.c')
-rw-r--r--lib/libc/string/memmem.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/string/memmem.c b/lib/libc/string/memmem.c
index b54931a9cfe..f94285abcfb 100644
--- a/lib/libc/string/memmem.c
+++ b/lib/libc/string/memmem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: memmem.c,v 1.1 2013/05/13 10:37:02 ajacoutot Exp $ */
+/* $OpenBSD: memmem.c,v 1.2 2013/05/15 12:45:59 ajacoutot Exp $ */
/*-
* Copyright (c) 2005 Pascal Gloor <pascal.gloor@spale.com>
*
@@ -42,7 +42,7 @@ memmem(const void *l, size_t l_len, const void *s, size_t s_len)
const char *cs = s;
/* a zero length needle should just return the haystack */
- if (l_len == 0)
+ if (s_len == 0)
return (void *)cl;
/* "s" must be smaller or equal to "l" */