summaryrefslogtreecommitdiffstats
path: root/Objects/structseq.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/structseq.c')
-rw-r--r--Objects/structseq.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/Objects/structseq.c b/Objects/structseq.c
index aee9528..14b5168 100644
--- a/Objects/structseq.c
+++ b/Objects/structseq.c
@@ -252,10 +252,7 @@ structseq_repr(PyStructSequence *obj)
}
/* "typename(", limited to TYPE_MAXSIZE */
- len = strlen(typ->tp_name) > TYPE_MAXSIZE ? TYPE_MAXSIZE :
- strlen(typ->tp_name);
- strncpy(pbuf, typ->tp_name, len);
- pbuf += len;
+ pbuf = stpncpy(pbuf, typ->tp_name, TYPE_MAXSIZE);
*pbuf++ = '(';
for (i=0; i < VISIBLE_SIZE(obj); i++) {