- use Tcl library for splitting and merging argument lists

This commit is contained in:
zolliker
2011-08-29 14:41:23 +00:00
parent 1e23f3c7b4
commit 56523419b2
5 changed files with 85 additions and 125 deletions

View File

@@ -3226,7 +3226,6 @@ static int SetSICSHdbProperty(SConnection * pCon, SicsInterp * pSics,
void *pData, int argc, char *argv[])
{
pHdb targetNode = NULL;
char buffer[512];
char *val;
if (argc < 4) {
@@ -3238,11 +3237,14 @@ static int SetSICSHdbProperty(SConnection * pCon, SicsInterp * pSics,
SCPrintf(pCon, eError, "ERROR: node %s not found", argv[1]);
return 0;
}
val = Arg2Tcl(argc - 3, &argv[3], buffer, sizeof buffer);
if (val) {
SetHdbProperty(targetNode, argv[2], val);
if (val != buffer)
if (argc == 4) {
SetHdbProperty(targetNode, argv[2], argv[3]);
} else {
val = Arg2Tcl(argc - 3, &argv[3], NULL, 0);
if (val) {
SetHdbProperty(targetNode, argv[2], val);
free(val);
}
}
SCSendOK(pCon);
return 1;