Bug #1491606 compiler warning fix
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9299 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
66c9ca9520
commit
5ee69cd80c
1 changed files with 4 additions and 4 deletions
|
|
@ -22,11 +22,11 @@ SWIG_AsArgcArgv(PyObject *input,
|
|||
*argv = %new_array(size + 1, char*);
|
||||
for (; i < size; ++i) {
|
||||
PyObject *obj = list ? PyList_GetItem(input,i) : PyTuple_GetItem(input,i);
|
||||
char *cptr = 0; size_t size = 0; int alloc = 0;
|
||||
res = SWIG_AsCharPtrAndSize(obj, &cptr, &size, &alloc);
|
||||
char *cptr = 0; size_t sz = 0; int alloc = 0;
|
||||
res = SWIG_AsCharPtrAndSize(obj, &cptr, &sz, &alloc);
|
||||
if (SWIG_IsOK(res)) {
|
||||
if (cptr && size) {
|
||||
(*argv)[i] = (alloc == SWIG_NEWOBJ) ? cptr : %new_copy_array(cptr, size, char);
|
||||
if (cptr && sz) {
|
||||
(*argv)[i] = (alloc == SWIG_NEWOBJ) ? cptr : %new_copy_array(cptr, sz, char);
|
||||
} else {
|
||||
(*argv)[i] = 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue