Use PyOS_snprintf() instead of sprintf and wrap the long line

This commit is contained in:
Neal Norwitz 2002-11-05 22:41:37 +00:00
parent 5d8d618c95
commit 03b109afc0

View file

@ -457,8 +457,10 @@ list_ass_slice(PyListObject *a, int ilow, int ihigh, PyObject *v)
n = 0;
else {
char msg[256];
sprintf(msg, "must assign sequence (not \"%.200s\") to slice",
v->ob_type->tp_name);
PyOS_snprintf(msg, sizeof(msg),
"must assign sequence"
" (not \"%.200s\") to slice",
v->ob_type->tp_name);
v_as_SF = PySequence_Fast(v, msg);
if(v_as_SF == NULL)
return -1;