summaryrefslogtreecommitdiff
path: root/src/libstddjb/str_diffn.c
blob: 28f37f62275f61cde5104e85e6f69fb61f50329f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* ISC license. */

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

#ifdef SKALIBS_FLAG_REPLACE_LIBC

int str_diffn (register char const *s, register char const *t, register unsigned int len)
{
  while (len--)
  {
    if (*s != *t) return *s - *t ;
    if (!*s) break ;
    s++ ; t++ ;
  }
  return 0 ;
}

#endif