Bug 1766561 - Adjust UTF-16 string formatting. r=nika

With MOZ_FORMAT_PRINTF annotations, the compiler expects a wchar_t*, and
it won't automatically consider char16ptr_t to be compatible with that.

While handling strings, there's one case of formatting that doesn't need
to use %S at all.

Differential Revision: https://phabricator.services.mozilla.com/D144919
This commit is contained in:
Mike Hommey
2022-05-03 20:49:09 +00:00
parent 30f26f1da0
commit e7f3aa6849
7 changed files with 22 additions and 19 deletions

View File

@@ -805,7 +805,7 @@ static nsresult CreateShortcutImpl(
// TODO: Properly escape quotes in the string, see bug 1604287.
nsString arguments;
for (auto& arg : aArguments) {
arguments.AppendPrintf("\"%S\" ", arg.get());
arguments.AppendPrintf("\"%S\" ", static_cast<const wchar_t*>(arg.get()));
}
link->SetArguments(arguments.get());