]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-45666: Use `%S` for MSVC and `%s` elsewhere for `swprintf` in `_testembed.c`...
authorNikita Sobolev <mail@sobolevn.me>
Mon, 1 Nov 2021 12:11:34 +0000 (15:11 +0300)
committerGitHub <noreply@github.com>
Mon, 1 Nov 2021 12:11:34 +0000 (20:11 +0800)
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Programs/_testembed.c

index 1ed3bd00edff609b44ac2d5912e5eb0e1bf36e76..8077c470c07c54d564bbf8e622427593270de29a 100644 (file)
@@ -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;
     }