From 401d25e92f62a9ef320a97542b3e63cb8c34e7e9 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Mon, 1 Nov 2021 15:11:34 +0300 Subject: [PATCH] bpo-45666: Use `%S` for MSVC and `%s` elsewhere for `swprintf` in `_testembed.c` (GH-29341) Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> --- Programs/_testembed.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Programs/_testembed.c b/Programs/_testembed.c index 1ed3bd00edf..8077c470c07 100644 --- a/Programs/_testembed.c +++ b/Programs/_testembed.c @@ -1733,7 +1733,13 @@ static int check_use_frozen_modules(const char *rawval) if (rawval == NULL) { wcscpy(optval, L"frozen_modules"); } - else if (swprintf(optval, 100, L"frozen_modules=%S", rawval) < 0) { + else if (swprintf(optval, 100, +#if defined(_MSC_VER) + L"frozen_modules=%S", +#else + L"frozen_modules=%s", +#endif + rawval) < 0) { error("rawval is too long"); return -1; }