diff options
Diffstat (limited to 'Objects/floatobject.c')
-rw-r--r-- | Objects/floatobject.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Objects/floatobject.c b/Objects/floatobject.c index cdc9620..02a1e1a 100644 --- a/Objects/floatobject.c +++ b/Objects/floatobject.c @@ -150,7 +150,8 @@ PyFloat_FromString(PyObject *v, char **pend) if (end > last) end = last; if (end == s) { - sprintf(buffer, "invalid literal for float(): %.200s", s); + PyOS_snprintf(buffer, sizeof(buffer), + "invalid literal for float(): %.200s", s); PyErr_SetString(PyExc_ValueError, buffer); return NULL; } @@ -159,7 +160,8 @@ PyFloat_FromString(PyObject *v, char **pend) while (*end && isspace(Py_CHARMASK(*end))) end++; if (*end != '\0') { - sprintf(buffer, "invalid literal for float(): %.200s", s); + PyOS_snprintf(buffer, sizeof(buffer), + "invalid literal for float(): %.200s", s); PyErr_SetString(PyExc_ValueError, buffer); return NULL; } |