summaryrefslogtreecommitdiffstats
path: root/Objects/structseq.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/structseq.c')
-rw-r--r--Objects/structseq.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Objects/structseq.c b/Objects/structseq.c
index 05ea87b..cf94155 100644
--- a/Objects/structseq.c
+++ b/Objects/structseq.c
@@ -182,9 +182,9 @@ structseq_repr(PyStructSequence *obj)
endofbuf= &buf[REPR_BUFFER_SIZE-5];
/* "typename(", limited to TYPE_MAXSIZE */
- len = strlen(typ->tp_name) > TYPE_MAXSIZE ? TYPE_MAXSIZE :
- strlen(typ->tp_name);
- strncpy(pbuf, typ->tp_name, len);
+ len = strlen(typ->tp_name);
+ len = Py_MIN(len, TYPE_MAXSIZE);
+ memcpy(pbuf, typ->tp_name, len);
pbuf += len;
*pbuf++ = '(';