- Introducted Arg2Tcl as a replacement for some calls to Arg2Text
- Fixed a memory leak
This commit is contained in:
13
tclintimpl.c
13
tclintimpl.c
@@ -135,7 +135,7 @@ int TclIntAction(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||
int argc, char *argv[]){
|
||||
pTclInt self = NULL;
|
||||
char pBuffer[1024];
|
||||
|
||||
char *cmd;
|
||||
|
||||
self = (pTclInt)pData;
|
||||
assert(self);
|
||||
@@ -159,11 +159,14 @@ int TclIntAction(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||
SCSendOK(pCon);
|
||||
return 1;
|
||||
} else if(strcmp(argv[1],"backup") == 0){
|
||||
Arg2Text(argc-2, &argv[2],pBuffer,1023);
|
||||
if(self->fd != NULL){
|
||||
fprintf(self->fd,"%s\n",pBuffer);
|
||||
cmd = Arg2Tcl(argc-2, &argv[2],pBuffer,1023);
|
||||
if (cmd) {
|
||||
if(self->fd != NULL){
|
||||
fprintf(self->fd,"%s\n",pBuffer);
|
||||
}
|
||||
if (cmd != pBuffer) free(cmd);
|
||||
SCSendOK(pCon);
|
||||
}
|
||||
SCSendOK(pCon);
|
||||
return 1;
|
||||
} else {
|
||||
sprintf(pBuffer,"ERROR: keyword %s to %s not recognized",
|
||||
|
||||
Reference in New Issue
Block a user