- 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:
32
exeman.c
32
exeman.c
@ -201,15 +201,15 @@ static int makeExePath(pExeMan self, SConnection * pCon, int argc,
|
||||
* do nothing to absolute path
|
||||
*/
|
||||
if (argv[2][0] == '/') {
|
||||
strncat(buffer, argv[2], 511 - strlen(buffer));
|
||||
strlcat(buffer, argv[2], 511 - strlen(buffer));
|
||||
SCWrite(pCon, buffer, eValue);
|
||||
return 1;
|
||||
}
|
||||
pPtr = self->batchPath;
|
||||
pPtr = stptok(pPtr, pPath, 131, ":");
|
||||
strncat(buffer, pPath, 511 - strlen(buffer));
|
||||
strncat(buffer, "/", 511 - strlen(buffer));
|
||||
strncat(buffer, argv[2], 511 - strlen(buffer));
|
||||
strlcat(buffer, pPath, 511 - strlen(buffer));
|
||||
strlcat(buffer, "/", 511 - strlen(buffer));
|
||||
strlcat(buffer, argv[2], 511 - strlen(buffer));
|
||||
SCWrite(pCon, buffer, eValue);
|
||||
|
||||
return 1;
|
||||
@ -363,8 +363,8 @@ int exeHdbNode(pHdb exeNode, SConnection * pCon)
|
||||
SCWrite(pCon, "ERROR: out of memory in exehdbNode", eError);
|
||||
return 0;
|
||||
}
|
||||
strncpy(conCon->deviceID, name, 255);
|
||||
strncpy(bufferNode, name, 511);
|
||||
strlcpy(conCon->deviceID, name, 255);
|
||||
strlcpy(bufferNode, name, 511);
|
||||
|
||||
/*
|
||||
* load commands into buffer
|
||||
@ -390,7 +390,7 @@ int exeHdbNode(pHdb exeNode, SConnection * pCon)
|
||||
}
|
||||
exeBufAppend(buffer, v.v.text);
|
||||
|
||||
strncpy(bufferNode, name, 511);
|
||||
strlcpy(bufferNode, name, 511);
|
||||
SCSetWriteFunc(conCon, SCHdbWrite);
|
||||
status = exeBufProcess(buffer, pServ->pSics, conCon, NULL, 0);
|
||||
SCDeleteConnection(conCon);
|
||||
@ -438,7 +438,7 @@ static int runHdbBuffer(pExeMan self, SConnection * pCon,
|
||||
* prepare context
|
||||
*/
|
||||
conCon = SCCopyConnection(pCon);
|
||||
strncpy(conCon->deviceID, pBueffel,255);
|
||||
strlcpy(conCon->deviceID, pBueffel,255);
|
||||
|
||||
/*
|
||||
* load commands into buffer
|
||||
@ -465,7 +465,7 @@ static int runHdbBuffer(pExeMan self, SConnection * pCon,
|
||||
}
|
||||
exeBufAppend(buffer, v.v.text);
|
||||
|
||||
strncpy(bufferNode, name, 511);
|
||||
strlcpy(bufferNode, name, 511);
|
||||
SCSetWriteFunc(conCon, SCHdbWrite);
|
||||
self->exeStackPtr++;
|
||||
self->runCon = conCon;
|
||||
@ -749,13 +749,13 @@ static int uploadForceSave(pExeMan self, SConnection * pCon,
|
||||
pPtr = self->batchPath;
|
||||
pPtr = stptok(pPtr, pPath, 131, ":");
|
||||
if (strlen(pPath) + 1 + strlen(argv[2]) <= 256) {
|
||||
strncat(pPath, "/",255);
|
||||
strncat(pPath, argv[2],255);
|
||||
strlcat(pPath, "/",255);
|
||||
strlcat(pPath, argv[2],255);
|
||||
} else {
|
||||
strncpy(pPath, argv[2], 255);
|
||||
strlcpy(pPath, argv[2], 255);
|
||||
}
|
||||
} else {
|
||||
strncpy(pPath, argv[2], 131);
|
||||
strlcpy(pPath, argv[2], 131);
|
||||
}
|
||||
|
||||
status = exeBufSave(self->uploadBuffer, pPath);
|
||||
@ -794,10 +794,10 @@ static int uploadSave(pExeMan self, SConnection * pCon,
|
||||
strcat(pPath, "/");
|
||||
strcat(pPath, argv[2]);
|
||||
} else {
|
||||
strncpy(pPath, argv[2], 255);
|
||||
strlcpy(pPath, argv[2], 255);
|
||||
}
|
||||
} else {
|
||||
strncpy(pPath, argv[2], 131);
|
||||
strlcpy(pPath, argv[2], 131);
|
||||
}
|
||||
if (fileExists(pPath)) {
|
||||
SCWrite(pCon, "ERROR: file exists", eError);
|
||||
@ -1299,7 +1299,7 @@ int ExeManagerWrapper(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
|
||||
|
||||
if (argc > 1) {
|
||||
strncpy(pBufferName, argv[1], 255);
|
||||
strlcpy(pBufferName, argv[1], 255);
|
||||
strtolower(argv[1]);
|
||||
status = handleBatchPath(self, pCon, argc, argv);
|
||||
if (status >= 0) {
|
||||
|
Reference in New Issue
Block a user