[Python] Fix -Wstringop-overflow warning

fixes #1332
This commit is contained in:
Julien Schueller 2018-10-01 09:31:42 +02:00 committed by GitHub
commit c0c2d90497
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -215,7 +215,7 @@ SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int
size_t size = strlen(name)+1;
gv->name = (char *)malloc(size);
if (gv->name) {
strncpy(gv->name,name,size);
memcpy(gv->name, name, size);
gv->get_attr = get_attr;
gv->set_attr = set_attr;
gv->next = v->vars;