Scilab portability fixes - remove use of strdup

This commit is contained in:
William S Fulton 2018-05-03 22:36:07 +01:00
commit 35c5a3a42a

View file

@ -49,8 +49,13 @@ static char *SWIG_Scilab_GetFuncName(void) {
static void SWIG_Scilab_SetFuncName(char *funcName) {
if (SwigFuncName != NULL) {
free(SwigFuncName);
SwigFuncName = NULL;
}
if (funcName) {
SwigFuncName = (char *)malloc(strlen(funcName) + 1);
if (SwigFuncName)
strcpy(SwigFuncName, funcName);
}
SwigFuncName = strdup(funcName);
}
/* Api context management functions */