MCPcopy Create free account
hub / github.com/coreboot/coreboot / strcasecmp

Function strcasecmp

payloads/libpayload/libc/string.c:47–58  ·  view source on GitHub ↗

* Compare two strings. * * @param s1 The first string. * @param s2 The second string. * @return Returns a value less than zero, if s1 is shorter than s2. Returns * zero, if s1 equals s2. Returns a value greater than zero, if * s1 is longer than s2. */

Source from the content-addressed store, hash-verified

45 * s1 is longer than s2.
46 */
47int strcasecmp(const char *s1, const char *s2)
48{
49 int res;
50
51 for (size_t i = 0; 1; i++) {
52 res = tolower(s1[i]) - tolower(s2[i]);
53 if (res || (s1[i] == '\0'))
54 break;
55 }
56
57 return res;
58}
59
60/**
61 * Compare two strings with fixed length.

Callers 13

region_numFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
msraddrbynameFunction · 0.85
mainFunction · 0.85
platform_identifyFunction · 0.85
compressFunction · 0.85
string_to_archFunction · 0.85
lookup_type_by_nameFunction · 0.85
cbfs_get_entryFunction · 0.85

Calls 1

tolowerFunction · 0.70

Tested by

no test coverage detected