- 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:
10
chadapter.c
10
chadapter.c
@@ -110,7 +110,7 @@ static int CHStatus(void *pData, SConnection * pCon)
|
||||
case HWFault:
|
||||
self->pDriv->GetError(self->pDriv, &iCode, pBueffel, 79);
|
||||
iRet = self->pDriv->TryFixIt(self->pDriv, iCode);
|
||||
sprintf(pError, "ERROR: %s", pBueffel);
|
||||
snprintf(pError,131, "ERROR: %s", pBueffel);
|
||||
SCWrite(pCon, pError, eError);
|
||||
if (iRet == CHFAIL || iRetry >= 3) {
|
||||
iRetry = 0;
|
||||
@@ -213,7 +213,7 @@ int CHAdapterFactory(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
}
|
||||
}
|
||||
if (!pChopper) {
|
||||
sprintf(pBueffel, "ERROR: %s is NO chopper controller", argv[3]);
|
||||
snprintf(pBueffel,255, "ERROR: %s is NO chopper controller", argv[3]);
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
return 0;
|
||||
}
|
||||
@@ -221,7 +221,7 @@ int CHAdapterFactory(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
/* interpret limits */
|
||||
iRet = Tcl_GetDouble(pSics->pTcl, argv[5], &dUpper);
|
||||
if (iRet != TCL_OK) {
|
||||
sprintf(pBueffel,
|
||||
snprintf(pBueffel,255,
|
||||
"ERROR: expected numeric argument for upper limit, got %s",
|
||||
argv[4]);
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
@@ -229,7 +229,7 @@ int CHAdapterFactory(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
}
|
||||
iRet = Tcl_GetDouble(pSics->pTcl, argv[4], &dLower);
|
||||
if (iRet != TCL_OK) {
|
||||
sprintf(pBueffel,
|
||||
snprintf(pBueffel,255,
|
||||
"ERROR: expected numeric argument for lower limit, got %s",
|
||||
argv[5]);
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
@@ -267,7 +267,7 @@ int CHAdapterFactory(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
/* install command */
|
||||
iRet = AddCommand(pSics, argv[1], CHAdapterAction, KillAdapter, pNew);
|
||||
if (!iRet) {
|
||||
sprintf(pBueffel,
|
||||
snprintf(pBueffel,255,
|
||||
"ERROR: duplicate ChopperAdapter command %s NOT created",
|
||||
argv[1]);
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
|
||||
Reference in New Issue
Block a user