mirror of
https://github.com/python/cpython.git
synced 2025-11-03 03:22:27 +00:00
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().
This commit is contained in:
parent
5f79f46612
commit
e822e37946
6 changed files with 27 additions and 32 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue