MCPcopy Create free account
hub / github.com/IntegralPilot/wasm_os / strcmp

Function strcmp

stdlib/c/string.c:4–12  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2#define _STRING_C
3
4int strcmp(const char* s1, const char* s2) {
5 while (*s1 && *s2 && *s1 == *s2) {
6 s1++;
7 s2++;
8 }
9 // Return the difference between the current characters pointed to by s1 and s2
10 // This correctly handles the case where one string might be shorter than the other
11 return (unsigned char)*s1 - (unsigned char)*s2;
12}
13
14unsigned long strlen(const char* str) {
15 unsigned long len = 0;

Callers 1

_startFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected