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

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

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