- Changed strncpy to strlcpy, strncat to strlcat
- Added strlcpy and strlcat to SICS - Added a driver for the POLDI power supplies
This commit is contained in:
@ -70,7 +70,7 @@ static void strcenter(char *str, char *target, int iLength)
|
||||
catch the error if target is to long
|
||||
*/
|
||||
if (strlen(str) >= iLength) {
|
||||
strncpy(target, str, iLength);
|
||||
strlcpy(target, str, iLength);
|
||||
}
|
||||
|
||||
iPtr = (iLength - strlen(str)) / 2;
|
||||
@ -230,7 +230,7 @@ static int TASHeader(pScanData self)
|
||||
DynarGet(self->pScanVar, i, &pPtr);
|
||||
pVar = (pVarEntry) pPtr;
|
||||
if (pVar) {
|
||||
strncpy(pWork2, ScanVarName(pVar), 59);
|
||||
strlcpy(pWork2, ScanVarName(pVar), 59);
|
||||
strtoupper(pWork2);
|
||||
sprintf(pWork, "D%s=%8.4f, ", pWork2, ScanVarStep(pVar));
|
||||
strcat(pBueffel, pWork);
|
||||
@ -411,7 +411,7 @@ static int TASHeader(pScanData self)
|
||||
pVar = (pVarEntry) pPtr;
|
||||
if (pVar) {
|
||||
strcat(pBueffel, "F9.4,1X,");
|
||||
strncpy(pWork2, pVar->Name, 59);
|
||||
strlcpy(pWork2, pVar->Name, 59);
|
||||
strtoupper(pWork2);
|
||||
strcenter(pWork2, pTen, 11);
|
||||
strcat(pHeader, pTen);
|
||||
|
Reference in New Issue
Block a user