MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / memcmp

Function memcmp

Kernel/src/string.cpp:88–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86
87extern "C"
88int memcmp(const void *s1, const void *s2, size_t n) {
89 const uint8_t* a = (uint8_t*)s1;
90 const uint8_t* b = (uint8_t*)s2;
91
92 for (size_t i = 0; i < n; i++) {
93 if (a[i] < b[i]) {
94 return -1;
95 } else if (a[i] > b[i]) {
96 return 1;
97 }
98 }
99
100 return 0;
101}
102
103void strcpy(char* dest, const char* src)
104{

Callers 3

FindSDTFunction · 0.85
InitFunction · 0.85
operator==Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected