From: Nikita Sobolev Date: Mon, 1 Nov 2021 12:11:34 +0000 (+0300) Subject: bpo-45666: Use `%S` for MSVC and `%s` elsewhere for `swprintf` in `_testembed.c`... X-Git-Tag: v3.11.0a2~34 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=401d25e92f62a9ef320a97542b3e63cb8c34e7e9;p=thirdparty%2FPython%2Fcpython.git 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> --- diff --git a/Programs/_testembed.c b/Programs/_testembed.c index 1ed3bd00edff..8077c470c07c 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; }