In article <20090410232748.gs25357__19460.5905832306$1239406176$gmane$...@danbala.tuwien.ac.at>, Thomas Klausner <w...@netbsd.org> wrote: >On Fri, Apr 10, 2009 at 07:13:38PM -0400, Christos Zoulas wrote: >> Module Name: src >> Committed By: christos >> Date: Fri Apr 10 23:13:38 UTC 2009 >> >> Modified Files: >> src/lib/libc/string: Makefile.inc memchr.3 >> Added Files: >> src/lib/libc/string: memrchr.c >> >> Log Message: >> add memrchr > >const unsigned char *p = s; > >Shouldn't this be >const unsigned char *p = s+n; >? > >But perhaps I misunderstand what it should do. I thought it would look >in the area [s, s+n-1] for c from the right. It seems to me that it >currently looks in [s-n+1, s] for c from the right.
The implementation that I saw did exactly that, but I looked more and it appears to be wrong. I will fix it. christos