- Introducted Arg2Tcl as a replacement for some calls to Arg2Text
- Fixed a memory leak
This commit is contained in:
18
remob.c
18
remob.c
@ -534,7 +534,11 @@ int RemobAction(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||
float fValue;
|
||||
long lID;
|
||||
char *endp;
|
||||
char *argv0;
|
||||
char *cmd;
|
||||
/*
|
||||
char acce[128], inte[128];
|
||||
*/
|
||||
int rights;
|
||||
RemChannel *rc;
|
||||
|
||||
@ -550,16 +554,19 @@ int RemobAction(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||
if (argc == 1) {
|
||||
iRet = RemTransact(remserver, rc, pCon, argv[0], ">", NULL);
|
||||
} else if (strcasecmp(argv[1],"list") == 0) {
|
||||
snprintf(buf, sizeof(buf), "%s ", remob->name);
|
||||
i = strlen(buf);
|
||||
Arg2Text(argc-1, argv+1, buf + i, sizeof buf - i);
|
||||
/*
|
||||
snprintf(acce, sizeof(acce), "!%s.accesscode", remob->name);
|
||||
snprintf(inte, sizeof(inte), "!%s.interruptmode", remob->name);
|
||||
*/
|
||||
|
||||
RemTransact(remserver, rc, pCon, buf, ">", NULL);
|
||||
|
||||
argv0 = argv[0];
|
||||
argv[0] = remob->name;
|
||||
cmd = Arg2Tcl(argc, argv, buf, sizeof buf);
|
||||
argv[0] = argv0;
|
||||
if (cmd) {
|
||||
RemTransact(remserver, rc, pCon, cmd, ">", NULL);
|
||||
if (cmd != buf) free(cmd);
|
||||
}
|
||||
iRet=1;
|
||||
} else {
|
||||
pos=snprintf(buf, sizeof(buf), "%s ", remob->name);
|
||||
@ -620,7 +627,6 @@ int RemServerAction(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||
float fValue;
|
||||
long lID;
|
||||
char *endp, *serverport, *thishostname;
|
||||
char acce[128], inte[128];
|
||||
struct sockaddr_in adr;
|
||||
struct hostent *thishost;
|
||||
Remob *p, *next;
|
||||
|
Reference in New Issue
Block a user