- After a bug at TRICS I replaced all occurrences of strcpy, strcat, sprintf
by length limited versions wherever appropriate.
This commit is contained in:
@ -255,7 +255,7 @@ static void PoldiStart(pPolterdi self, SConnection * pCon)
|
||||
return;
|
||||
}
|
||||
if (scancheck == 0) {
|
||||
sprintf(pBueffel, "Writing %s ......", self->pFile);
|
||||
snprintf(pBueffel,255, "Writing %s ......", self->pFile);
|
||||
SCWrite(pCon, pBueffel, eLog);
|
||||
}
|
||||
|
||||
@ -483,7 +483,7 @@ static void PoldiUpdate(pPolterdi self, SConnection * pCon)
|
||||
}
|
||||
if (scancheck == 0) {
|
||||
time(&zeit);
|
||||
sprintf(pBueffel, "Updating %s on %s ", self->pFile,
|
||||
snprintf(pBueffel,255, "Updating %s on %s ", self->pFile,
|
||||
asctime(localtime(&zeit)));
|
||||
SCWrite(pCon, pBueffel, eWarning);
|
||||
}
|
||||
@ -752,7 +752,7 @@ int PolterAction(SConnection * pCon, SicsInterp * pSics,
|
||||
}
|
||||
return 1;
|
||||
} else if (strcmp(argv[1], "getfile") == 0) {
|
||||
sprintf(pBueffel, "StoreData.file = %s", self->pFile);
|
||||
snprintf(pBueffel,511, "StoreData.file = %s", self->pFile);
|
||||
SCWrite(pCon, pBueffel, eValue);
|
||||
return 1;
|
||||
} else if (strcmp(argv[1], "interval") == 0) {
|
||||
@ -762,7 +762,7 @@ int PolterAction(SConnection * pCon, SicsInterp * pSics,
|
||||
}
|
||||
iRet = Tcl_GetInt(pSics->pTcl, argv[2], &iVal);
|
||||
if (iRet != TCL_OK) {
|
||||
sprintf(pBueffel, "ERROR: cannot convert --> %s <-- to number ",
|
||||
snprintf(pBueffel,511, "ERROR: cannot convert --> %s <-- to number ",
|
||||
argv[2]);
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user