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

by length limited versions wherever appropriate.
This commit is contained in:
koennecke
2009-12-04 12:58:45 +00:00
parent 09826fb097
commit 4127cbb166
9 changed files with 42 additions and 43 deletions

View File

@ -89,13 +89,13 @@ int FocusAverageDo(SConnection * pCon, SicsInterp * pSics, void *pData,
}
iRet = Tcl_GetInt(pSics->pTcl, argv[1], &iStart);
if (iRet != TCL_OK) {
sprintf(pBueffel, "ERROR: cannot convert %s to integer", argv[1]);
snprintf(pBueffel,255, "ERROR: cannot convert %s to integer", argv[1]);
SCWrite(pCon, pBueffel, eError);
return 0;
}
iRet = Tcl_GetInt(pSics->pTcl, argv[2], &iEnd);
if (iRet != TCL_OK) {
sprintf(pBueffel, "ERROR: cannot convert %s to integer", argv[2]);
snprintf(pBueffel,255, "ERROR: cannot convert %s to integer", argv[2]);
SCWrite(pCon, pBueffel, eError);
return 0;
}
@ -105,7 +105,7 @@ int FocusAverageDo(SConnection * pCon, SicsInterp * pSics, void *pData,
if (argc > 3) {
iRet = Tcl_GetInt(pSics->pTcl, argv[3], &iBank);
if (iRet != TCL_OK) {
sprintf(pBueffel, "ERROR: cannot convert %s to integer", argv[3]);
snprintf(pBueffel,255, "ERROR: cannot convert %s to integer", argv[3]);
SCWrite(pCon, pBueffel, eError);
return 0;
}
@ -347,18 +347,18 @@ int MakeFA(SConnection * pCon, SicsInterp * pSics, void *pData,
/* find histogram memory */
pCom = FindCommand(pSics, argv[2]);
if (!pCom) {
sprintf(pBueffel, "ERROR: histogram memory %s NOT found!", argv[2]);
snprintf(pBueffel,255, "ERROR: histogram memory %s NOT found!", argv[2]);
SCWrite(pCon, pBueffel, eError);
return 0;
}
pDum = (pDummy) pCom->pData;
if (!pDum) {
sprintf(pBueffel, "ERROR: histogram memory %s INVALID!", argv[2]);
snprintf(pBueffel,255, "ERROR: histogram memory %s INVALID!", argv[2]);
SCWrite(pCon, pBueffel, eError);
return 0;
}
if (strcmp(pDum->pDescriptor->name, "HMcontrol") != 0) {
sprintf(pBueffel, "ERROR: %s is NO histogram control object!",
snprintf(pBueffel,255, "ERROR: %s is NO histogram control object!",
argv[2]);
SCWrite(pCon, pBueffel, eError);
return 0;