mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
More sprintf -> PyOS_snprintf.
This commit is contained in:
parent
179c48c60e
commit
75cdad5584
5 changed files with 14 additions and 9 deletions
|
@ -778,7 +778,8 @@ strop_atoi(PyObject *self, PyObject *args)
|
|||
return NULL;
|
||||
}
|
||||
else if (errno != 0) {
|
||||
sprintf(buffer, "atoi() literal too large: %.200s", s);
|
||||
PyOS_snprintf(buffer, sizeof(buffer),
|
||||
"atoi() literal too large: %.200s", s);
|
||||
PyErr_SetString(PyExc_ValueError, buffer);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -828,7 +829,8 @@ strop_atol(PyObject *self, PyObject *args)
|
|||
while (*end && isspace(Py_CHARMASK(*end)))
|
||||
end++;
|
||||
if (*end != '\0') {
|
||||
sprintf(buffer, "invalid literal for atol(): %.200s", s);
|
||||
PyOS_snprintf(buffer, sizeof(buffer),
|
||||
"invalid literal for atol(): %.200s", s);
|
||||
PyErr_SetString(PyExc_ValueError, buffer);
|
||||
Py_DECREF(x);
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue