summaryrefslogtreecommitdiff
path: root/src/boot/libc/strcmp.c
blob: ab0c5cf725250304826885770e51ad1fd16014e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include "libc/strcmp.h"

s32 strcmp(const char* str1, const char* str2) {
    char c1;
    char c2;

    do {
        c1 = *str1++;
        c2 = *str2++;
        if (c1 != c2) {
            return c1 - c2;
        }
    } while (c1);

    return 0;
}