diff options
author | Nikita Sobolev <mail@sobolevn.me> | 2021-11-01 12:11:34 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-01 12:11:34 (GMT) |
commit | 401d25e92f62a9ef320a97542b3e63cb8c34e7e9 (patch) | |
tree | 4c91cd57ffaa6ac2e9f2ef9784fb831cd01ce871 /Programs/_testembed.c | |
parent | e73283a20fb05b70da2990decefac0e011faec17 (diff) | |
download | cpython-401d25e92f62a9ef320a97542b3e63cb8c34e7e9.zip cpython-401d25e92f62a9ef320a97542b3e63cb8c34e7e9.tar.gz cpython-401d25e92f62a9ef320a97542b3e63cb8c34e7e9.tar.bz2 |
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>
Diffstat (limited to 'Programs/_testembed.c')
-rw-r--r-- | Programs/_testembed.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Programs/_testembed.c b/Programs/_testembed.c index 1ed3bd0..8077c47 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; } |