skalibs

Mirror/fork of https://skarnet.org/software/skalibs/
git clone https://ccx.te2000.cz/git/skalibs
Log | Files | Refs | README | LICENSE

str_chr.c (172B)


      1 /* ISC license. */
      2 
      3 #include <string.h>
      4 #include <skalibs/bytestr.h>
      5 
      6 size_t str_chr (char const *s, int c)
      7 {
      8   char *p = strchr(s, c) ;
      9   return p ? p - s : strlen(s) ;
     10 }