Re: 2.2.10-ac7 compile errors on Alpha

Jeff Garzik (jgarzik@pobox.com)
Sat, 03 Jul 1999 21:31:59 -0400


Graffiti wrote:
>
> > 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?

The '--' following the 'n' implies that n is decremented after the
current statement is evaluated. So if n == 0, you are still ok.

Jeff

-- 
He's pretty fly for a rabbi

- 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/