- 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
simchop.c
12
simchop.c
@ -145,11 +145,11 @@ static int SDGetPar(pCodri self, char *parname, char *pBuffer, int iBufLen)
|
||||
/* are we busy driving something? */
|
||||
if (time(NULL) < pPriv->tTarget) {
|
||||
if (strcmp(parname, "speed") == 0) {
|
||||
sprintf(pBueffel, "%f", pPriv->fRot - 1.);
|
||||
snprintf(pBueffel,sizeof(pBueffel)-1, "%f", pPriv->fRot - 1.);
|
||||
} else if (strcmp(parname, "phase") == 0) {
|
||||
sprintf(pBueffel, "%f", pPriv->fPhase - 1.);
|
||||
snprintf(pBueffel,sizeof(pBueffel)-1, "%f", pPriv->fPhase - 1.);
|
||||
} else if (strcmp(parname, "ratio") == 0) {
|
||||
sprintf(pBueffel, "%f", pPriv->fRatio - 1.);
|
||||
snprintf(pBueffel,sizeof(pBueffel)-1, "%f", pPriv->fRatio - 1.);
|
||||
} else {
|
||||
pPriv->iError = UNKNOWNPAR;
|
||||
return 0;
|
||||
@ -160,11 +160,11 @@ static int SDGetPar(pCodri self, char *parname, char *pBuffer, int iBufLen)
|
||||
|
||||
/* all normal */
|
||||
if (strcmp(parname, "speed") == 0) {
|
||||
sprintf(pBueffel, "%f", pPriv->fRot);
|
||||
snprintf(pBueffel,sizeof(pBueffel)-1, "%f", pPriv->fRot);
|
||||
} else if (strcmp(parname, "phase") == 0) {
|
||||
sprintf(pBueffel, "%f", pPriv->fPhase);
|
||||
snprintf(pBueffel,sizeof(pBueffel)-1, "%f", pPriv->fPhase);
|
||||
} else if (strcmp(parname, "ratio") == 0) {
|
||||
sprintf(pBueffel, "%f", pPriv->fRatio);
|
||||
snprintf(pBueffel,sizeof(pBueffel)-1, "%f", pPriv->fRatio);
|
||||
} else {
|
||||
pPriv->iError = UNKNOWNPAR;
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user