Scilab: fix arrays_global test_case
This commit is contained in:
parent
255603639f
commit
6735b9727f
1 changed files with 9 additions and 5 deletions
|
|
@ -99,23 +99,27 @@ SWIGINTERN int
|
|||
SwigScilabStringToCharPtr(void *_pvApiCtx, int _iVar, char *_pcValue, int _iLength, char *_fname) {
|
||||
SciErr sciErr;
|
||||
int *piAddrVar = NULL;
|
||||
char* pcTmpValue = NULL;
|
||||
int iRet;
|
||||
|
||||
if (_pcValue == NULL) {
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
|
||||
sciErr = getVarAddressFromPosition(_pvApiCtx, _iVar, &piAddrVar);
|
||||
if (sciErr.iErr) {
|
||||
printError(&sciErr, 0);
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
|
||||
if (_pcValue == NULL) {
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
|
||||
iRet = getAllocatedSingleString(_pvApiCtx, piAddrVar, &_pcValue);
|
||||
iRet = getAllocatedSingleString(_pvApiCtx, piAddrVar, &pcTmpValue);
|
||||
if (iRet) {
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
|
||||
strncpy(_pcValue, pcTmpValue, _iLength);
|
||||
free(pcTmpValue);
|
||||
|
||||
return SWIG_OK;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue