From 79b5a24bd4a5159e266968e34ec814283e2d7c42 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sun, 25 Apr 2010 20:49:29 +0000 Subject: [PATCH] [MKHIVE] Fix a buggy format string (%s --> %S). Add _wcsicmp to rtl.c. svn path=/trunk/; revision=47022 --- reactos/tools/mkhive/reginf.c | 2 +- reactos/tools/mkhive/rtl.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/reactos/tools/mkhive/reginf.c b/reactos/tools/mkhive/reginf.c index cdf0c5b2c95..9e03c08c668 100644 --- a/reactos/tools/mkhive/reginf.c +++ b/reactos/tools/mkhive/reginf.c @@ -354,7 +354,7 @@ do_reg_operation( if (Data == NULL) return FALSE; - DPRINT("setting binary data %s len %d\n", ValueName, Size); + DPRINT("setting binary data %S len %d\n", ValueName, Size); InfHostGetBinaryField (Context, 5, Data, Size, NULL); } diff --git a/reactos/tools/mkhive/rtl.c b/reactos/tools/mkhive/rtl.c index e9ed22b66e0..a68d7a0672c 100644 --- a/reactos/tools/mkhive/rtl.c +++ b/reactos/tools/mkhive/rtl.c @@ -207,3 +207,32 @@ unsigned char BitScanReverse(ULONG * const Index, unsigned long Mask) } return Mask ? 1 : 0; } + +#undef tolower +WCHAR towlower(WCHAR ch) +{ + if (ch < L'A') + { + return ch; + } + else if (ch <= L'Z') + { + return ch + (L'a' - L'A'); + } + + return ch; +} + +int _wcsicmp(PCWSTR cs, PCWSTR ct) +{ + while (towlower(*cs) == towlower(*ct)) + { + if (*cs == 0) + return 0; + + cs++; + ct++; + } + + return towlower(*cs) - towlower(*ct); +} -- 2.17.1