- 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:
12
hmdata.c
12
hmdata.c
@ -110,10 +110,10 @@ int configureHMdata(pHMdata self, pStringDict pOpt, SConnection * pCon)
|
||||
self->rank = (int) rint(fVal);
|
||||
|
||||
for (i = 0; i < self->rank; i++) {
|
||||
sprintf(pValue, "dim%1.1d", i);
|
||||
snprintf(pValue,sizeof(pValue)-1, "dim%1.1d", i);
|
||||
status = StringDictGetAsNumber(pOpt, pValue, &fVal);
|
||||
if (!status) {
|
||||
sprintf(pValue, "ERROR dimension %d not found!!", i);
|
||||
snprintf(pValue,sizeof(pValue)-1, "ERROR dimension %d not found!!", i);
|
||||
return 0;
|
||||
}
|
||||
self->iDim[i] = (int) rint(fVal);
|
||||
@ -304,7 +304,7 @@ static int updateHMbuffer(pHistMem hist, int bank, SConnection * pCon)
|
||||
break;
|
||||
} else {
|
||||
status = hist->pDriv->GetError(hist->pDriv, &iErr, pError, 79);
|
||||
sprintf(pBueffel, "ERROR: %s ", pError);
|
||||
snprintf(pBueffel,sizeof(pBueffel)-1, "ERROR: %s ", pError);
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
status = hist->pDriv->TryAndFixIt(hist->pDriv, iErr);
|
||||
if (status == COTERM) {
|
||||
@ -416,13 +416,13 @@ long sumHMDataRectangle(pHistMem hist, SConnection * pCon,
|
||||
}
|
||||
for (i = 0; i < myrank; i++) {
|
||||
if ((iStart[i] < 0) || (iStart[i] > self->iDim[i])) {
|
||||
sprintf(pBueffel, "ERROR: %d is out of data dimension range",
|
||||
snprintf(pBueffel,sizeof(pBueffel)-1, "ERROR: %d is out of data dimension range",
|
||||
iStart[i]);
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
return -1;
|
||||
}
|
||||
if ((iEnd[i] < 0) || (iEnd[i] > self->iDim[i])) {
|
||||
sprintf(pBueffel, "ERROR: %d is out of data dimension range",
|
||||
snprintf(pBueffel,sizeof(pBueffel)-1, "ERROR: %d is out of data dimension range",
|
||||
iEnd[i]);
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
return -1;
|
||||
@ -469,7 +469,7 @@ long sumHMDataRectangle(pHistMem hist, SConnection * pCon,
|
||||
}
|
||||
break;
|
||||
default:
|
||||
sprintf(pBueffel,
|
||||
snprintf(pBueffel,sizeof(pBueffel)-1,
|
||||
"ERROR: summing in %d dimensions not yet implemented", myrank);
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
return -1;
|
||||
|
Reference in New Issue
Block a user