https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2ac49f0824ccbb814eeab…
commit 2ac49f0824ccbb814eeabb83cf9b3724a8ce7214
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Mon Mar 21 21:06:07 2022 +0100
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Thu Apr 7 03:19:06 2022 +0200
[SDK:RTL] Minimal formatting for NLS functions + Remove inadequate assert in
RtlUpcaseUnicodeToOemN().
---
sdk/lib/rtl/nls.c | 10 +++++-----
sdk/lib/rtl/unicode.c | 8 ++++----
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/sdk/lib/rtl/nls.c b/sdk/lib/rtl/nls.c
index a875379ca15..35f19c6a77c 100644
--- a/sdk/lib/rtl/nls.c
+++ b/sdk/lib/rtl/nls.c
@@ -251,7 +251,9 @@ RtlMultiByteToUnicodeN(OUT PWCHAR UnicodeString,
*ResultSize = Size * sizeof(WCHAR);
for (i = 0; i < Size; i++)
+ {
UnicodeString[i] = NlsAnsiToUnicodeTable[(UCHAR)MbString[i]];
+ }
}
else
{
@@ -331,7 +333,7 @@ RtlMultiByteToUnicodeSize(OUT PULONG UnicodeSize,
if (!NlsMbCodePageTag)
{
/* single-byte code page */
- *UnicodeSize = MbSize * sizeof (WCHAR);
+ *UnicodeSize = MbSize * sizeof(WCHAR);
}
else
{
@@ -535,8 +537,8 @@ RtlUnicodeToMultiByteN(OUT PCHAR MbString,
if (!NlsMbCodePageTag)
{
/* single-byte code page */
- Size = (UnicodeSize > (MbSize * sizeof (WCHAR)))
- ? MbSize : (UnicodeSize / sizeof (WCHAR));
+ Size = (UnicodeSize > (MbSize * sizeof(WCHAR)))
+ ? MbSize : (UnicodeSize / sizeof(WCHAR));
if (ResultSize)
*ResultSize = Size;
@@ -830,8 +832,6 @@ RtlUpcaseUnicodeToOemN(OUT PCHAR OemString,
PAGED_CODE_RTL();
- ASSERT(NlsUnicodeToOemTable != NULL);
-
if (!NlsMbOemCodePageTag)
{
/* single-byte code page */
diff --git a/sdk/lib/rtl/unicode.c b/sdk/lib/rtl/unicode.c
index c7e85948f98..8c7248db155 100644
--- a/sdk/lib/rtl/unicode.c
+++ b/sdk/lib/rtl/unicode.c
@@ -101,7 +101,7 @@ RtlAnsiStringToUnicodeString(
if (NlsMbCodePageTag == FALSE)
{
- Length = AnsiSource->Length * 2 + sizeof(WCHAR);
+ Length = (AnsiSource->Length + 1) * sizeof(WCHAR);
}
else
{
@@ -2236,7 +2236,7 @@ RtlCopyString(
PCHAR p1, p2;
/* Check if there was no source given */
- if(!SourceString)
+ if (!SourceString)
{
/* Simply return an empty string */
DestinationString->Length = 0;
@@ -2275,7 +2275,7 @@ RtlCopyUnicodeString(
{
ULONG SourceLength;
- if(SourceString == NULL)
+ if (!SourceString)
{
DestinationString->Length = 0;
}
@@ -2431,7 +2431,7 @@ RtlAppendUnicodeToString(IN OUT PUNICODE_STRING Destination,
Destination->Length += Length;
/* append terminating '\0' if enough space */
- if(Destination->MaximumLength > Destination->Length)
+ if (Destination->MaximumLength > Destination->Length)
{
DestBuffer[Length / sizeof(WCHAR)] = UNICODE_NULL;
}