aboutsummaryrefslogtreecommitdiff
path: root/src/mlibc/string/strcmp.c
blob: cc719daaf5e3ccb5d4e8cba5ac6f5597dc4e1a75 (plain) (blame)
1
2
3
4
5
6
7
8
9
#include <mlibc/string.h>

char strcmp(const char *a, const char *b) {
    if (strlen(a) != strlen(b)) return 1;

    for (size_t i = 0; i < strlen(a); i++) if (a[i] != b[i]) return 1;

    return 0;
}