- Introducted Arg2Tcl as a replacement for some calls to Arg2Text

- Fixed a memory leak
This commit is contained in:
zolliker
2006-04-11 07:26:55 +00:00
parent e25fb68080
commit da3dfd9d76
11 changed files with 184 additions and 92 deletions

View File

@@ -411,6 +411,7 @@
char pBueffel[256];
Tcl_Interp *pTcl = NULL;
int iRet;
char *cmd;
assert(pCon);
assert(pSics);
@@ -425,8 +426,13 @@
pTcl = InterpGetTcl(pSics);
assert(pTcl);
Arg2Text(argc-1,&argv[1],pBueffel,255);
iRet = Tcl_Eval(pTcl,pBueffel);
cmd = Arg2Tcl(argc-1,&argv[1],pBueffel,sizeof pBueffel);
if (!cmd) {
SCWrite(pCon,"ERROR: no more memory",eError);
return 0;
}
iRet = Tcl_Eval(pTcl,cmd);
if (cmd != pBueffel) free(cmd);
if(strlen(pTcl->result) > 1)
{
SCWrite(pCon,pTcl->result,eValue);