summaryrefslogtreecommitdiff
path: root/lib/string/strcmp.c
blob: afcb1b7c06be705ff4c450be331bd9d1a301c6b3 (plain)
1
2
3
4
5
6
7
8
9
10
/* SPDX-License-Identifier: MIT */
/* Derived from musl libc (Copyright © 2005-2020 Rich Felker, et al.) */

#include <string.h>

int strcmp(const char *l, const char *r)
{
	for (; *l==*r && *l; l++, r++);
	return *(unsigned char *)l - *(unsigned char *)r;
}