]> granicus.if.org Git - python/commitdiff
Use PyOS_snprintf() instead of sprintf and wrap the long line
authorNeal Norwitz <nnorwitz@gmail.com>
Tue, 5 Nov 2002 22:41:37 +0000 (22:41 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Tue, 5 Nov 2002 22:41:37 +0000 (22:41 +0000)
Objects/listobject.c

index c28bfb485a7a7e40f20b92a614df2af552e69ddb..bee284d6077aae04e882d1fb0871fc6d88d46e7f 100644 (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;