[Xcb] [Bug 4232] xlsclients much too slow over network

Ian Osgood iano at quirkster.com
Thu Sep 3 13:15:29 PDT 2009


On Sep 2, 2009, at 8:49 AM, Peter Harris wrote:

>  - Re-implement strnlen for people who have only ISO C.
>
> Peter Harris

How about using memchr?  (I don't know what kind of #ifdefs to wrap  
this in, though.)

size_t strnlen(const char *s, size_t len)
{
	const char *end = (const char *)memchr(s, 0, len);
	return end ? end-s : len;
}

Ian




More information about the Xcb mailing list