summaryrefslogtreecommitdiff
path: root/kernel/libc/string/memcmp.c
blob: deeb0290b663222787d5dbce623347e0c3daf26c (plain)
1
2
3
4
5
6
7
8
9
10
11
#include "../include/string.h"

int memcmp(const void *s1, const void *s2, u32 n) {
  int return_value = 0;

  for (u32 i = 0; i < n; i++)
    if (((unsigned char *)(s1))[i] != ((unsigned char *)(s2))[i])
      return_value++;

  return return_value;
}