summaryrefslogtreecommitdiff
path: root/kernel/libc/string/isequal.c
blob: cdbd3cc924b87d7452d354914d3d0e5c679a5f35 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include "../include/string.h"

int isequal(const char *s1, const char *s2) {
    for(;*s1;s1++,s2++)
        if(*s1 != *s2)
            return 0;
    return 1;
}

int isequal_n(const char *s1, const char *s2, uint32_t n) {
    for(;*s1 && n;s1++,s2++,n--)
        if(*s1 != *s2)
            return 0;
    return 1;
}