Scilab: fix arrays_global test case
This commit is contained in:
parent
67d4079e1f
commit
7655b6df6d
1 changed files with 4 additions and 5 deletions
|
|
@ -102,10 +102,6 @@ SwigScilabStringToCharPtr(void *_pvApiCtx, int _iVar, char *_pcValue, int _iLeng
|
|||
char* pcTmpValue = NULL;
|
||||
int iRet;
|
||||
|
||||
if (_pcValue == NULL) {
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
|
||||
sciErr = getVarAddressFromPosition(_pvApiCtx, _iVar, &piAddrVar);
|
||||
if (sciErr.iErr) {
|
||||
printError(&sciErr, 0);
|
||||
|
|
@ -117,7 +113,10 @@ SwigScilabStringToCharPtr(void *_pvApiCtx, int _iVar, char *_pcValue, int _iLeng
|
|||
return SWIG_ERROR;
|
||||
}
|
||||
|
||||
strncpy(_pcValue, pcTmpValue, _iLength);
|
||||
if (_pcValue != NULL) {
|
||||
strncpy(_pcValue, pcTmpValue, _iLength);
|
||||
}
|
||||
|
||||
free(pcTmpValue);
|
||||
|
||||
return SWIG_OK;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue