summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-06-15 20:20:10 (GMT)
committerGitHub <noreply@github.com>2020-06-15 20:20:10 (GMT)
commitb498c7f1b3890e43ea2e7d1570f8403707ea4cc6 (patch)
tree25c15e5106769850ee4037aa00805671cb95a322 /Parser
parent9a0624a3d9feb0c7664ace7a894a04e4af547661 (diff)
downloadcpython-b498c7f1b3890e43ea2e7d1570f8403707ea4cc6.zip
cpython-b498c7f1b3890e43ea2e7d1570f8403707ea4cc6.tar.gz
cpython-b498c7f1b3890e43ea2e7d1570f8403707ea4cc6.tar.bz2
bpo-36020: Remove snprintf macro in pyerrors.h (GH-20889)
On Windows, GH-include "pyerrors.h" no longer defines "snprintf" and "vsnprintf" macros. PyOS_snprintf() and PyOS_vsnprintf() should be used to get portable behavior. Replace snprintf() calls with PyOS_snprintf() and replace vsnprintf() calls with PyOS_vsnprintf(). (cherry picked from commit e822e37946f27c09953bb5733acf3b07c2db690f) Co-authored-by: Victor Stinner <vstinner@python.org>
Diffstat (limited to 'Parser')
-rw-r--r--Parser/tokenizer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c
index d461e4e..f3c1d9b 100644
--- a/Parser/tokenizer.c
+++ b/Parser/tokenizer.c
@@ -1133,7 +1133,7 @@ verify_identifier(struct tok_state *tok)
Py_DECREF(s);
// PyUnicode_FromFormatV() does not support %X
char hex[9];
- snprintf(hex, sizeof(hex), "%04X", ch);
+ (void)PyOS_snprintf(hex, sizeof(hex), "%04X", ch);
if (Py_UNICODE_ISPRINTABLE(ch)) {
syntaxerror(tok, "invalid character '%c' (U+%s)", ch, hex);
}