Re: [PATCH] compat: add memrchr()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jonathan Nieder <jrnieder <at> gmail.com> writes:

> 
> Reimplement another handy convenience function from glibc.  memrchr()
> searches from the end of a memory area for a particular character.  It
> is similar to strrchr() but takes a length argument and is
> binary-safe.

System memrchr uses a byte comparison rather than an int comparison.

"The memchr() function scans the first n bytes of the memory area pointed to by
s for the character c. The first byte to match c (interpreted as an unsigned
character) stops the operation. "

See: http://linux.die.net/man/3/memrchr

It's a good idea to do the same thing for compatibility reasons.

/Ludde



--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]