In multiple places strings are copied from one place to another, but instead of using strdup or the str* functions, the project seems to prefer malloc+memcpy, which IMHO results in less readable more error-prone code.
Examples of this:
|
memcpy(rtd->key, key, sizeof(char)*keylen); |
|
memcpy(ret, xmlstr, sizeof(char)*(strlen(xmlstr)+1)); |
|
memcpy(attr->name, name, sizeof(char)*(strlen(name)+1)); |
|
memcpy(attr->val, val, sizeof(char)*(strlen(val)+1)); |
.. and many others.
In multiple places strings are copied from one place to another, but instead of using
strdupor thestr*functions, the project seems to prefermalloc+memcpy, which IMHO results in less readable more error-prone code.Examples of this:
libcomps/libcomps/src/comps_objmradix.c
Line 46 in 2ed0fe5
libcomps/libcomps/src/comps_doc.c
Line 263 in 2ed0fe5
libcomps/libcomps/src/comps_elem.c
Line 890 in 2ed0fe5
libcomps/libcomps/src/comps_elem.c
Line 891 in 2ed0fe5
.. and many others.