This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add strchrnul


On 03/27/2011 09:37 PM, Yaakov (Cygwin/X) wrote:
> I'm attaching a patch and new C file to implement strchrnul, a GNU
> extension.
> 
> Corinna: patch for winsup being posted to cygwin-patches.

> char *
> _DEFUN (strchrnul, (s1, i),
> 	_CONST char *s1 _AND
> 	int i)
> {
>   char *s = strchr(s1, i);
> 
>   if (*s != NULL)

Oops.  That's a SEGV waiting to happen.

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]