summaryrefslogtreecommitdiffhomepage
path: root/src/argv
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2019-08-29 10:23:47 +0000
committermidipix <writeonce@midipix.org>2019-08-29 10:36:32 +0000
commit20aed341c2090379ae8291c94383c58f546d2d02 (patch)
tree08626ba6d95bd08d068c8d56959d94359ab3b258 /src/argv
parent1da90790a17f62183380bfea0f894d5a3cd33e50 (diff)
downloadntapi-20aed341c2090379ae8291c94383c58f546d2d02.tar.bz2
ntapi-20aed341c2090379ae8291c94383c58f546d2d02.tar.xz
__ntapi_tt_array_convert_utf16_to_utf8(): coding style: replace while with for.
Diffstat (limited to 'src/argv')
-rw-r--r--src/argv/ntapi_tt_array_utf16.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/argv/ntapi_tt_array_utf16.c b/src/argv/ntapi_tt_array_utf16.c
index d035ad4..d125331 100644
--- a/src/argv/ntapi_tt_array_utf16.c
+++ b/src/argv/ntapi_tt_array_utf16.c
@@ -173,12 +173,12 @@ int32_t __stdcall __ntapi_tt_array_convert_utf16_to_utf8(
ubound = (uint8_t *)buffer + buffer_len - 5;
diff = (uintptr_t)base / sizeof(wchar16_t);
- while (warrv && *warrv) {
+ for (; warrv && *warrv; arrv++,warrv++) {
*arrv = (char *)(ch-(uintptr_t)base);
wch = *warrv + diff;
/* ubound already accounts for null termination, see above */
- while (*wch && (ch < ubound)) {
+ for (; *wch && (ch<ubound); ) {
if (*wch <= 0x7F) {
/* from: 00000000 0xxxxxxx (little endian) */
/* to: 0xxxxxxx (utf-8) */
@@ -284,14 +284,10 @@ int32_t __stdcall __ntapi_tt_array_convert_utf16_to_utf8(
wch++;
}
- /* null termination */
if (*wch)
return NT_STATUS_BUFFER_TOO_SMALL;
- else
- *ch++ = 0;
- arrv++;
- warrv++;
+ *ch++ = 0;
}
*arrv = 0;