- 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:
18
scan.c
18
scan.c
@ -151,14 +151,14 @@ pScanData CreateScanObject(char *pRecover, char *pHeader, pCounter pCount,
|
||||
|
||||
/* assign various things */
|
||||
if (pRecover) {
|
||||
strncpy(pNew->pRecover, pRecover,1024);
|
||||
strlcpy(pNew->pRecover, pRecover,1024);
|
||||
}
|
||||
if (pHeader) {
|
||||
strncpy(pNew->pHeaderFile, pHeader,1024);
|
||||
strlcpy(pNew->pHeaderFile, pHeader,1024);
|
||||
}
|
||||
pNew->iMode = eTimer;
|
||||
pNew->fPreset = 10.;
|
||||
strncpy(pNew->pCounterName, pCount->name,511);
|
||||
strlcpy(pNew->pCounterName, pCount->name,511);
|
||||
pNew->pCounterData = pCount;
|
||||
pNew->PrepareScan = PrepareScan;
|
||||
pNew->WriteHeader = WriteHeader;
|
||||
@ -167,7 +167,7 @@ pScanData CreateScanObject(char *pRecover, char *pHeader, pCounter pCount,
|
||||
pNew->ScanCount = ScanCount;
|
||||
pNew->CollectScanData = CollectScanData;
|
||||
pNew->iWindow = 6;
|
||||
strncpy(pNew->objectName, objName, 131);
|
||||
strlcpy(pNew->objectName, objName, 131);
|
||||
ConfigureScanDict(pNew->scanFunctions);
|
||||
|
||||
return pNew;
|
||||
@ -800,7 +800,7 @@ int ContinueScan(pScanData self, SicsInterp * pSics, SConnection * pCon,
|
||||
}
|
||||
snprintf(pBueffel,sizeof(pBueffel)-1, "Writing data file: %s ...", pPtr);
|
||||
SCWrite(self->pCon, pBueffel, eWarning);
|
||||
strncpy(self->pFile, pPtr,1023);
|
||||
strlcpy(self->pFile, pPtr,1023);
|
||||
free(pPtr);
|
||||
iRet = self->WriteHeader(self);
|
||||
if (!iRet) {
|
||||
@ -986,7 +986,7 @@ int GetScanVarName(pScanData self, int iWhich, char *pName, int iLength)
|
||||
DynarGet(self->pScanVar, iWhich, &pPtr);
|
||||
pVar = (pVarEntry) pPtr;
|
||||
if (pVar) {
|
||||
strncpy(pName, ScanVarName(pVar), iLength);
|
||||
strlcpy(pName, ScanVarName(pVar), iLength);
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
@ -1401,7 +1401,7 @@ static void PrintScanVars(pScanData self, char *scanname,
|
||||
DynarGet(self->pScanVar, i, &pPtr);
|
||||
pVar = (pVarEntry) pPtr;
|
||||
if (pVar != NULL) {
|
||||
strncat(pBueffel, ScanVarName(pVar), 1023 - strlen(pBueffel));
|
||||
strlcat(pBueffel, ScanVarName(pVar), 1023 - strlen(pBueffel));
|
||||
strcat(pBueffel, " ");
|
||||
}
|
||||
}
|
||||
@ -1594,7 +1594,7 @@ static int DumpScan(pScanData self, SConnection * pCon)
|
||||
*/
|
||||
oldCon = self->pCon;
|
||||
pFile[0] = '\0';
|
||||
strncpy(pFile, self->pFile, 1023);
|
||||
strlcpy(pFile, self->pFile, 1023);
|
||||
prepareDataFile(self);
|
||||
self->pCon = pCon;
|
||||
self->WriteHeader(self);
|
||||
@ -1603,7 +1603,7 @@ static int DumpScan(pScanData self, SConnection * pCon)
|
||||
}
|
||||
SCWrite(pCon, "Scan dumped", eValue);
|
||||
self->pCon = oldCon;
|
||||
strncpy(self->pFile, pFile, 1023);
|
||||
strlcpy(self->pFile, pFile, 1023);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user