- 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:
22
devexec.c
22
devexec.c
@ -84,7 +84,7 @@ int openDevexecLog()
|
||||
if (devLog == NULL) {
|
||||
fileName = IFindOption(pSICSOptions, "devexeclog");
|
||||
if (fileName != NULL) {
|
||||
strcpy(fileBuffer, fileName);
|
||||
strncpy(fileBuffer, fileName,1024);
|
||||
} else {
|
||||
iDate = time(NULL);
|
||||
psTime = localtime(&iDate);
|
||||
@ -370,7 +370,7 @@ int StartDevice(pExeList self, char *name, pObjectDescriptor pDes,
|
||||
DevexecLog("START", pNew->name);
|
||||
return 1;
|
||||
} else {
|
||||
sprintf(pBueffel, "ERROR: cannot start device %s", name);
|
||||
snprintf(pBueffel,131, "ERROR: cannot start device %s", name);
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
DeleteDevEntry(pNew);
|
||||
if (LLDcheck(self->iList) >= LIST_EMPTY) {
|
||||
@ -398,25 +398,25 @@ int StartMotor(pExeList self, SicsInterp * pSics, SConnection * pCon,
|
||||
|
||||
pCom = FindCommand(pSics, name);
|
||||
if (!pCom) {
|
||||
sprintf(pBueffel, "ERROR: cannot find motor %s", name);
|
||||
snprintf(pBueffel,255, "ERROR: cannot find motor %s", name);
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
return 0;
|
||||
}
|
||||
pMot = (pDummy) pCom->pData;
|
||||
if (!pMot) {
|
||||
sprintf(pBueffel, "ERROR: %s is no motor ", name);
|
||||
snprintf(pBueffel,255, "ERROR: %s is no motor ", name);
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if (!pMot->pDescriptor) {
|
||||
sprintf(pBueffel, "ERROR: cannot find motor %s", name);
|
||||
snprintf(pBueffel,255, "ERROR: cannot find motor %s", name);
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
return 0;
|
||||
}
|
||||
if (!pMot->pDescriptor->GetInterface(pMot, DRIVEID)) {
|
||||
sprintf(pBueffel, "ERROR: %s is no motor", name);
|
||||
snprintf(pBueffel, 255, "ERROR: %s is no motor", name);
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
return 0;
|
||||
}
|
||||
@ -438,25 +438,25 @@ int StartCounter(pExeList self, SicsInterp * pSics, SConnection * pCon,
|
||||
|
||||
pCom = FindCommand(pSics, name);
|
||||
if (!pCom) {
|
||||
sprintf(pBueffel, "ERROR: cannot find counter %s", name);
|
||||
snprintf(pBueffel,255, "ERROR: cannot find counter %s", name);
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
return 0;
|
||||
}
|
||||
pCter = (pCounter) pCom->pData;
|
||||
if (!pCter) {
|
||||
sprintf(pBueffel, "ERROR: %s is no counter ", name);
|
||||
snprintf(pBueffel,255, "ERROR: %s is no counter ", name);
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if (!pCter->pDes) {
|
||||
sprintf(pBueffel, "ERROR: cannot find counter %s", name);
|
||||
snprintf(pBueffel, 255, "ERROR: cannot find counter %s", name);
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
return 0;
|
||||
}
|
||||
if (!pCter->pDes->GetInterface(pCter, COUNTID)) {
|
||||
sprintf(pBueffel, "ERROR: %s is no counter", name);
|
||||
snprintf(pBueffel,255, "ERROR: %s is no counter", name);
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
return 0;
|
||||
}
|
||||
@ -1000,7 +1000,7 @@ int StopCommand(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
|
||||
iRet = StopExe(self, argv[1]);
|
||||
if (!iRet) {
|
||||
sprintf(pBueffel, "ERROR: %s not found, so could not halt", argv[1]);
|
||||
snprintf(pBueffel,131, "ERROR: %s not found, so could not halt", argv[1]);
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
}
|
||||
return iRet;
|
||||
|
Reference in New Issue
Block a user