MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / StrniCmp

Function StrniCmp

rEFIt_UEFI/entry_scan/common.cpp:201–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199
200#define TO_LOWER(ch) (((ch >= L'A') && (ch <= L'Z')) ? ((ch - L'A') + L'a') : ch)
201INTN StrniCmp(IN CONST CHAR16 *Str1,
202 IN CONST CHAR16 *Str2,
203 IN UINTN Count)
204{
205 CHAR16 Ch1, Ch2;
206 if (Count == 0) {
207 return 0;
208 }
209 if (Str1 == NULL) {
210 if (Str2 == NULL) {
211 return 0;
212 } else {
213 return -1;
214 }
215 } else if (Str2 == NULL) {
216 return 1;
217 }
218 do {
219 Ch1 = TO_LOWER(*Str1);
220 Ch2 = TO_LOWER(*Str2);
221 Str1++;
222 Str2++;
223 if (Ch1 != Ch2) {
224 return (Ch1 - Ch2);
225 }
226 if (Ch1 == 0) {
227 return 0;
228 }
229 } while (--Count > 0);
230 return 0;
231}
232
233CONST CHAR16 *StriStr(IN CONST CHAR16 *Str,
234 IN CONST CHAR16 *SearchFor)

Callers 2

StriStrFunction · 0.70
AskUserForFilePathFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected