aboutsummaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
authorRyan Prichard <rprichard@google.com>2019-10-22 17:40:22 -0700
committerRyan Prichard <rprichard@google.com>2019-10-22 17:40:22 -0700
commitdf2273f8f4c7854f753665e68bb305a221f010a9 (patch)
tree61e52f1b262943d114609f6c6c56f403f95624ec /sources
parente28404042f83c6d59d3acd76da045b770d45079e (diff)
downloadndk-df2273f8f4c7854f753665e68bb305a221f010a9.tar.gz
Switch %lS to %ls
Either should work, but the Linux man page for printf(3) advises against using %S. In C/POSIX, %S is an alias for %ls. I see two other recommendations for %ls: - https://devblogs.microsoft.com/oldnewthing/20190830-00/?p=102823 - https://bugzilla.mozilla.org/show_bug.cgi?id=1577872#c7 Bug: https://github.com/android/ndk/issues/1106 Test: manual Change-Id: I298b37bc87582837b3c4f92752a983ec52332982
Diffstat (limited to 'sources')
-rw-r--r--sources/host-tools/toolbox/cmp_win.c4
-rw-r--r--sources/host-tools/toolbox/echo_win.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/sources/host-tools/toolbox/cmp_win.c b/sources/host-tools/toolbox/cmp_win.c
index 2d1ec82dc..36a73a84f 100644
--- a/sources/host-tools/toolbox/cmp_win.c
+++ b/sources/host-tools/toolbox/cmp_win.c
@@ -61,12 +61,12 @@ int main(void)
const wchar_t* filename2 = argv[1];
FILE *f1 = _wfopen(filename1, L"rb");
if (!f1) {
- wprintf(L"ERROR: can't open file %lS\n", filename1);
+ wprintf(L"ERROR: can't open file %ls\n", filename1);
exit(1);
}
FILE *f2 = _wfopen(filename2, L"rb");
if (!f2) {
- wprintf(L"ERROR: can't open file %lS\n", filename2);
+ wprintf(L"ERROR: can't open file %ls\n", filename2);
fclose(f1);
exit(1);
}
diff --git a/sources/host-tools/toolbox/echo_win.c b/sources/host-tools/toolbox/echo_win.c
index 6c8b8824c..492290392 100644
--- a/sources/host-tools/toolbox/echo_win.c
+++ b/sources/host-tools/toolbox/echo_win.c
@@ -58,7 +58,7 @@ int main(void)
}
for (int i = 0; i < argc; ++i) {
- wprintf(L"%lS%lS", ((i > 0) ? L" " : L""), argv[i]);
+ wprintf(L"%ls%ls", ((i > 0) ? L" " : L""), argv[i]);
}
if (!flagNoNewline) {
wprintf(L"\n");