source: trunk/libs/newlib/src/newlib/libc/string/strchrnul.c @ 577

Last change on this file since 577 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 794 bytes
Line 
1/*
2FUNCTION
3        <<strchrnul>>---search for character in string
4
5INDEX
6        strchrnul
7
8SYNOPSIS
9        #include <string.h>
10        char * strchrnul(const char *<[string]>, int <[c]>);
11
12DESCRIPTION
13        This function finds the first occurence of <[c]> (converted to
14        a char) in the string pointed to by <[string]> (including the
15        terminating null character).
16
17RETURNS
18        Returns a pointer to the located character, or a pointer
19        to the concluding null byte if <[c]> does not occur in <[string]>.
20
21PORTABILITY
22<<strchrnul>> is a GNU extension.
23
24<<strchrnul>> requires no supporting OS subroutines.  It uses
25strchr() and strlen() from elsewhere in this library.
26
27QUICKREF
28        strchrnul
29*/
30
31#include <string.h>
32
33char *
34strchrnul (const char *s1,
35        int i)
36{
37  char *s = strchr(s1, i);
38
39  return s ? s : (char *)s1 + strlen(s1);
40}
Note: See TracBrowser for help on using the repository browser.