- After a bug at TRICS I replaced all occurrences of strcpy, strcat, sprintf

by length limited versions wherever appropriate.


SKIPPED:
	psi/el755driv.c
	psi/faverage.c
	psi/frame.c
	psi/lmd200.c
	psi/polterwrite.c
	psi/psi.c
	psi/sanswave.c
	psi/sinqhmdriv.c
	psi/termprot.c
This commit is contained in:
koennecke
2009-12-04 12:58:31 +00:00
parent 297f9f2e02
commit 8cc5474334
80 changed files with 899 additions and 881 deletions

View File

@ -161,7 +161,7 @@ static int HMCTransfer(void *pData, SConnection * pCon)
status = self->slaves[i]->TransferData(self->slaveData[i], pCon);
if (status != OKOK) {
retVal = status;
sprintf(pBueffel,
snprintf(pBueffel,sizeof(pBueffel)-1,
"WARNING: slave histogram %d failed to transfer data", i);
SCWrite(pCon, pBueffel, eWarning);
}
@ -260,14 +260,14 @@ int MakeHMControl(SConnection * pCon, SicsInterp * pSics,
for (i = 2; i < argc; i++) {
pCom = FindCommand(pSics, argv[i]);
if (!pCom) {
sprintf(pBueffel, "ERROR: object %s not found in MakeHMcontrol",
snprintf(pBueffel,sizeof(pBueffel)-1, "ERROR: object %s not found in MakeHMcontrol",
argv[i]);
SCWrite(pCon, pBueffel, eError);
continue;
}
pCount = GetCountableInterface(pCom->pData);
if (!pCount) {
sprintf(pBueffel, "ERROR: object %s is NOT countable", argv[i]);
snprintf(pBueffel,sizeof(pBueffel)-1, "ERROR: object %s is NOT countable", argv[i]);
SCWrite(pCon, pBueffel, eError);
continue;
}
@ -282,7 +282,7 @@ int MakeHMControl(SConnection * pCon, SicsInterp * pSics,
status = AddCommand(pSics, argv[1], HMControlAction, KillHMcontrol,
pNew);
if (!status) {
sprintf(pBueffel, "ERROR: duplicate command %s not created", argv[1]);
snprintf(pBueffel,sizeof(pBueffel)-1, "ERROR: duplicate command %s not created", argv[1]);
SCWrite(pCon, pBueffel, eError);
KillHMcontrol(pNew);
return 0;
@ -320,7 +320,7 @@ int HMControlAction(SConnection * pCon, SicsInterp * pSics,
*/
status = Tcl_GetDouble(pSics->pTcl, argv[2], &dPreset);
if (status != TCL_OK) {
sprintf(pBueffel, "ERROR: failed to convert %s to number", argv[2]);
snprintf(pBueffel,sizeof(pBueffel)-1, "ERROR: failed to convert %s to number", argv[2]);
SCWrite(pCon, pBueffel, eError);
return 0;
}
@ -330,7 +330,7 @@ int HMControlAction(SConnection * pCon, SicsInterp * pSics,
else if (strcmp(argv[3], "monitor") == 0)
eMode = ePreset;
else {
sprintf(pBueffel, "ERROR: %s is no recognized count mode", argv[3]);
snprintf(pBueffel,sizeof(pBueffel)-1, "ERROR: %s is no recognized count mode", argv[3]);
SCWrite(pCon, pBueffel, eError);
return 0;
}