summaryrefslogtreecommitdiff
path: root/src/libstddjb/str_chr.c
blob: a415de6400ef2af942e238aa7d2873db453db2af (plain)
1
2
3
4
5
6
7
8
9
10
11
/* ISC license. */

#include <sys/types.h>
#include <string.h>
#include <skalibs/bytestr.h>

size_t str_chr (char const *s, int c)
{
  char *p = strchr(s, c) ;
  return p ? p - s : strlen(s) ;
}