summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikita Sobolev <mail@sobolevn.me>2021-10-31 02:13:54 (GMT)
committerGitHub <noreply@github.com>2021-10-31 02:13:54 (GMT)
commitaad48062ef8f983fbb95f9dc0c3c3cef9c89df02 (patch)
treeaf3e12ffdd00c993bf47c2ec66f333107b8abf10
parentaae18a17401dc36917c0f64f971d60ab1a5b477e (diff)
downloadcpython-aad48062ef8f983fbb95f9dc0c3c3cef9c89df02.zip
cpython-aad48062ef8f983fbb95f9dc0c3c3cef9c89df02.tar.gz
cpython-aad48062ef8f983fbb95f9dc0c3c3cef9c89df02.tar.bz2
bpo-45666: fixes warning with `swprintf` and `%s` (GH-29307)
-rw-r--r--Misc/NEWS.d/next/Build/2021-10-29-12-54-53.bpo-45666.w2G63u.rst1
-rw-r--r--Programs/_testembed.c2
2 files changed, 2 insertions, 1 deletions
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 0000000..8a3e6fe
--- /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 6fe18d9..1ed3bd0 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;
}