On Thu, Aug 14, 2014 at 07:16:36PM +0200, Tanguy Pruvot wrote:
> size_t utf8len( const char* s )
> {
>    size_t n = 0;
>    while (*s)
>      if ((*s++ ^ 0x40) < 0xC0)
>        n++;
>    return n;
> }
> 
> you need to test s != NULL, else *s will crash

Says who? NULL is not a valid pointer. Should you also check for
things like s != (char *)-1 ? What value would you return then,
anyway?

Rich
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to