- Changed strncpy to strlcpy, strncat to strlcat
- Added strlcpy and strlcat to SICS - Added a driver for the POLDI power supplies SKIPPED: psi/A1931.c psi/autowin.c psi/bruker.c psi/docho.c psi/dornier2.c psi/dspcode.c psi/ease.c psi/ecb.c psi/ecbcounter.c psi/ecbdriv.c psi/el734dc.c psi/el734driv.c psi/el734hp.c psi/el737driv.c psi/el737hpdriv.c psi/el737hpdrivsps.c psi/el737hpv2driv.c psi/el755driv.c psi/eurodriv.c psi/haakedriv.c psi/itc4driv.c psi/julcho.c psi/linadriv.c psi/lmd200.c psi/lscsupport.c psi/ltc11.c psi/make_gen psi/oicom.c psi/oxinst.c psi/pimotor.c psi/pipiezo.c psi/polterwrite.c psi/psi.c psi/sanscook.c psi/sanslirebin.c psi/sanswave.c psi/sinqhmdriv.c psi/sinqhttp.c psi/slsecho.c psi/slsmagnet.c psi/slsvme.c psi/sps.c psi/swmotor.c psi/swmotor2.c psi/tabledrive.c psi/tasscan.c psi/tdchm.c psi/velodorn.c psi/velodornier.c
This commit is contained in:
22
nxscript.c
22
nxscript.c
@@ -279,8 +279,8 @@ static void putMotor(SConnection * pCon, SicsInterp * pSics,
|
||||
/*
|
||||
if alias_null is available: write zero point
|
||||
*/
|
||||
strncpy(buffer, argv[2],131);
|
||||
strncat(buffer, "_null",131);
|
||||
strlcpy(buffer, argv[2],131);
|
||||
strlcat(buffer, "_null",131);
|
||||
if (NXDdefget(self->dictHandle, buffer, dummy, 255)) {
|
||||
MotorGetPar(brumm, "softzero", &fVal);
|
||||
status =
|
||||
@@ -326,8 +326,8 @@ static void putCounter(SConnection * pCon, SicsInterp * pSics,
|
||||
do preset
|
||||
*/
|
||||
fVal = GetCounterPreset(cter);
|
||||
strncpy(newAlias, argv[2],255);
|
||||
strncat(newAlias, "_preset",255);
|
||||
strlcpy(newAlias, argv[2],255);
|
||||
strlcat(newAlias, "_preset",255);
|
||||
status =
|
||||
NXDputalias(self->fileHandle, self->dictHandle, newAlias, &fVal);
|
||||
if (status != NX_OK) {
|
||||
@@ -357,8 +357,8 @@ static void putCounter(SConnection * pCon, SicsInterp * pSics,
|
||||
do time
|
||||
*/
|
||||
fVal = GetCountTime(cter, pCon);
|
||||
strncpy(newAlias, argv[2],255);
|
||||
strncat(newAlias, "_time",255);
|
||||
strlcpy(newAlias, argv[2],255);
|
||||
strlcat(newAlias, "_time",255);
|
||||
if (NXDdefget(self->dictHandle, newAlias, dummy, 79)) {
|
||||
status =
|
||||
NXDputalias(self->fileHandle, self->dictHandle, newAlias, &fVal);
|
||||
@@ -474,7 +474,7 @@ static void putHdb(SConnection * pCon, SicsInterp * pSics, pNXScript self,
|
||||
argv[2]);
|
||||
return;
|
||||
} else {
|
||||
strncpy(alias, argv[3], 512);
|
||||
strlcpy(alias, argv[3], 512);
|
||||
}
|
||||
}
|
||||
GetHipadabaPar(node, &v, pCon);
|
||||
@@ -540,7 +540,7 @@ static void putHdbOff(SConnection * pCon, SicsInterp * pSics, pNXScript self,
|
||||
argv[2]);
|
||||
return;
|
||||
} else {
|
||||
strncpy(alias, argv[4], 512);
|
||||
strlcpy(alias, argv[4], 512);
|
||||
}
|
||||
}
|
||||
offset = atoi(argv[3]);
|
||||
@@ -1319,10 +1319,10 @@ static int handlePut(SConnection * pCon, SicsInterp * pSics,
|
||||
return 1;
|
||||
}
|
||||
if (strlen(defString) < 900) {
|
||||
strncat(defString, " -dim {",1024);
|
||||
strlcat(defString, " -dim {",1024);
|
||||
snprintf(numBuf,sizeof(numBuf)-1, "%d", (int) strlen(buffer) + 1);
|
||||
strncat(defString, numBuf,1024);
|
||||
strncat(defString, " }",1024);
|
||||
strlcat(defString, numBuf,1024);
|
||||
strlcat(defString, " }",1024);
|
||||
} else {
|
||||
SCWrite(pCon, "ERROR: out of definition string space in puttext",
|
||||
eLogError);
|
||||
|
||||
Reference in New Issue
Block a user