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

#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) ;
}