- 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:
koennecke
2009-12-04 12:58:31 +00:00
parent 297f9f2e02
commit 8cc5474334
80 changed files with 899 additions and 881 deletions

View File

@@ -118,7 +118,7 @@ static long ColliderSetValue(void *pData, SConnection * pCon,
if (iRet != TCL_OK) {
SCWrite(pCon, "ERROR: Movement not possible or bad collider script",
eError);
SCWrite(pCon, Tcl_DStringValue(&command), eError);
SCPrintf(pCon,eError, "%s returned %s", Tcl_DStringValue(&command), Tcl_GetStringResult(pServ->pSics->pTcl));
/*
SCWrite(pCon,pServ->pSics->pTcl->result,eError);
*/
@@ -213,7 +213,7 @@ int StartLevel(int level, int sequenceList, int motorList,
*/
count++;
} else {
sprintf(pBueffel,
snprintf(pBueffel,131,
"ERROR: motor %s, requested from anticollider script",
seq.pMotor);
SCWrite(pCon, pBueffel, eError);
@@ -236,7 +236,7 @@ static void ListSequence(int sequenceList, SConnection * pCon)
iRet = LLDnodePtr2First(sequenceList);
while (iRet != 0) {
LLDnodeDataTo(sequenceList, &seq);
sprintf(pBueffel, "%d %s %f", seq.level, seq.pMotor, seq.target);
snprintf(pBueffel,131, "%d %s %f", seq.level, seq.pMotor, seq.target);
SCWrite(pCon, pBueffel, eValue);
iRet = LLDnodePtr2Next(sequenceList);
}
@@ -371,7 +371,7 @@ int AntiColliderAction(SConnection * pCon, SicsInterp * pSics,
return 0;
}
if (FindDrivable(pSics, argv[2]) == NULL) {
sprintf(pBueffel, "ERROR: %s is NOT drivable, cannot register",
snprintf(pBueffel,255, "ERROR: %s is NOT drivable, cannot register",
argv[2]);
SCWrite(pCon, pBueffel, eError);
return 0;
@@ -389,7 +389,7 @@ int AntiColliderAction(SConnection * pCon, SicsInterp * pSics,
} else if (strcmp(argv[1], "add") == 0) {
if (argc < 5) {
SCWrite(pCon,
"ERROR: InsUfficient number of arguments to anticollicion add",
"ERROR: Insufficient number of arguments to anticollicion add",
eError);
return 0;
}