[Python-checkins] bpo-45666: fixes warning with `swprintf` and `%s` (GH-29307)

Fidget-Spinner webhook-mailer at python.org
Sat Oct 30 22:14:03 EDT 2021


https://github.com/python/cpython/commit/aad48062ef8f983fbb95f9dc0c3c3cef9c89df02
commit: aad48062ef8f983fbb95f9dc0c3c3cef9c89df02
branch: main
author: Nikita Sobolev <mail at sobolevn.me>
committer: Fidget-Spinner <28750310+Fidget-Spinner at users.noreply.github.com>
date: 2021-10-31T10:13:54+08:00
summary:

bpo-45666: fixes warning with `swprintf` and `%s` (GH-29307)

files:
A Misc/NEWS.d/next/Build/2021-10-29-12-54-53.bpo-45666.w2G63u.rst
M Programs/_testembed.c

diff --git a/Misc/NEWS.d/next/Build/2021-10-29-12-54-53.bpo-45666.w2G63u.rst b/Misc/NEWS.d/next/Build/2021-10-29-12-54-53.bpo-45666.w2G63u.rst
new file mode 100644
index 0000000000000..8a3e6feded856
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2021-10-29-12-54-53.bpo-45666.w2G63u.rst
@@ -0,0 +1 @@
+Fix warning of ``swprintf`` and ``%s`` usage in ``_testembed.c``
diff --git a/Programs/_testembed.c b/Programs/_testembed.c
index 6fe18d93a73ae..1ed3bd00edff6 100644
--- a/Programs/_testembed.c
+++ b/Programs/_testembed.c
@@ -1733,7 +1733,7 @@ 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, L"frozen_modules=%S", rawval) < 0) {
         error("rawval is too long");
         return -1;
     }



More information about the Python-checkins mailing list