fix warnings/errors for gcc4.0, icc and valgrind
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7689 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
cc9f9be00f
commit
8bcc0bf8eb
12 changed files with 24 additions and 65 deletions
|
|
@ -482,7 +482,7 @@ SWIG_As##CharName##Array(SWIG_Object obj, Char *val, size_t size)
|
|||
if ((csize == size + 1) && cptr && !(cptr[csize-1])) --csize;
|
||||
if (csize <= size) {
|
||||
if (val) {
|
||||
if (csize) memcpy(val, cptr, csize);
|
||||
if (csize) memcpy(val, cptr, csize*sizeof(Char));
|
||||
if (csize < size) memset(val + csize, 0, (size - csize)*sizeof(Char));
|
||||
if (alloc == SWIG_NEWOBJ) SWIG_delete_array(cptr);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue