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

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

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