diff options
author | Victor Stinner <vstinner@python.org> | 2020-06-15 19:59:47 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-15 19:59:47 (GMT) |
commit | e822e37946f27c09953bb5733acf3b07c2db690f (patch) | |
tree | d0bb8d8769be9f469aa6675fb820bc41acfd65c5 /Parser/tokenizer.c | |
parent | 5f79f46612c351bde78a41c5264c42db21008868 (diff) | |
download | cpython-e822e37946f27c09953bb5733acf3b07c2db690f.zip cpython-e822e37946f27c09953bb5733acf3b07c2db690f.tar.gz cpython-e822e37946f27c09953bb5733acf3b07c2db690f.tar.bz2 |
bpo-36020: Remove snprintf macro in pyerrors.h (GH-20889)
On Windows, #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().
Diffstat (limited to 'Parser/tokenizer.c')
-rw-r--r-- | Parser/tokenizer.c | 2 |
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); } |