diff options
author | Tim Peters <tim.peters@gmail.com> | 2001-11-28 22:07:30 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2001-11-28 22:07:30 (GMT) |
commit | 75cdad558472781162a83439f3e6edb61d4d40e6 (patch) | |
tree | d4c4d78f70a7e37860209ac8a2b9019d24b997cc /Modules/stropmodule.c | |
parent | 179c48c60e2476643863313ee0e0aa01bf338ad9 (diff) | |
download | cpython-75cdad558472781162a83439f3e6edb61d4d40e6.zip cpython-75cdad558472781162a83439f3e6edb61d4d40e6.tar.gz cpython-75cdad558472781162a83439f3e6edb61d4d40e6.tar.bz2 |
More sprintf -> PyOS_snprintf.
Diffstat (limited to 'Modules/stropmodule.c')
-rw-r--r-- | Modules/stropmodule.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/stropmodule.c b/Modules/stropmodule.c index 3c5de2b..54d444f 100644 --- a/Modules/stropmodule.c +++ b/Modules/stropmodule.c @@ -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; |