diff --git a/Objects/structseq.c b/Objects/structseq.c index 7ad607b0e39..2ab9b52055b 100644 --- a/Objects/structseq.c +++ b/Objects/structseq.c @@ -102,7 +102,8 @@ structseq_new(PyTypeObject *type, PyObject *args, PyObject *kwds) len = PySequence_Length(arg); required_len = REAL_SIZE_TP(type); if (len != required_len) { - sprintf(msgbuf, + PyOS_snprintf( + msgbuf, sizeof(msgbuf), "constructor takes exactly %d arguments (%d given)", required_len, len);