diff options
author | Ryan Prichard <rprichard@google.com> | 2019-10-22 17:40:22 -0700 |
---|---|---|
committer | Ryan Prichard <rprichard@google.com> | 2019-10-22 17:40:22 -0700 |
commit | df2273f8f4c7854f753665e68bb305a221f010a9 (patch) | |
tree | 61e52f1b262943d114609f6c6c56f403f95624ec /sources | |
parent | e28404042f83c6d59d3acd76da045b770d45079e (diff) | |
download | ndk-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.c | 4 | ||||
-rw-r--r-- | sources/host-tools/toolbox/echo_win.c | 2 |
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"); |