Re: 2.2.10-ac7 compile errors on Alpha

Graffiti (ramune@lycaeus.calstatela.edu)
Sat, 3 Jul 1999 16:40:08 -0700


> void *memchr(const void *s, int c, size_t n)
> {
> while (n-- != 0) {
^^^^^^^^

Is memchr() guaranteed to be called only with n >= 1?
Otherwise, wouldn't:
while (n-- > 0) {
be a better choice?

> if (c == (char *)s++) {
> return s-1;
> }
> }
> return NULL;
> }

-- DN

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/