memchr() on x86

Ali Gholami Rudi <[email protected]> Sat, 3 Sep 2011 06:50:55 +0000 (UTC)
Newsgroups gmane.linux.lib.dietlibc
Message-ID <[email protected]>
Hi,

dietlibc's memchr() implementation for x86 seems to read one more
character than asked on x86.  A small example is included; the middle
memchr() is expected to return NULL, AFAICT.

	Ali

#include <stdio.h>
#include <string.h>

int main(void)
{
	char *s = "1234";
	printf("%p %p %p\n",
		memchr(s, '3', 1), memchr(s, '3', 2), memchr(s, '3', 3));
	return 0;
}