File: strchrnul.c

package info (click to toggle)
andi 0.14-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 988 kB
  • sloc: ansic: 2,296; sh: 426; cpp: 99; makefile: 76; awk: 51
file content (10 lines) | stat: -rw-r--r-- 259 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
/* @brief Here follows a simple implementation of the GNU function `strchrnul`.
 * Please check the gnulib manual for details.
 */
#include <string.h>

char *strchrnul(const char *s, int c){
	char *p = strchr(s,c);

	return p != NULL ? p : strchr(s, '\0');
}