- 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

@@ -47,7 +47,7 @@ static void syncLogin(void)
/*
try a login
*/
sprintf(pBueffel, "%s %s\n", looser, password);
snprintf(pBueffel,sizeof(pBueffel)-1, "%s %s\n", looser, password);
test = NETWrite(connection, pBueffel, strlen(pBueffel));
if (test != 1) {
printf("Failed at writing user/password\n");
@@ -136,7 +136,7 @@ int MakeSync(SConnection * pCon, SicsInterp * pSics, void *pData,
*/
iRet = AddCommand(pSics, "sync", Synchronize, killSync, NULL);
if (!iRet) {
sprintf(pBueffel, "ERROR: duplicate command sync not created");
snprintf(pBueffel,sizeof(pBueffel)-1, "ERROR: duplicate command sync not created");
killSync(NULL);
SCWrite(pCon, pBueffel, eError);
return 0;
@@ -165,7 +165,7 @@ tryagain:
if (connection == NULL) {
syncLogin();
if (connection == NULL) {
sprintf(pBueffel, "ERROR: failed to connect to %s, %d for sync 'ing",
snprintf(pBueffel,sizeof(pBueffel)-1, "ERROR: failed to connect to %s, %d for sync 'ing",
hostname, port);
SCWrite(pCon, pBueffel, eError);
return 0;
@@ -252,7 +252,7 @@ tryagain:
}
if (syncFile != NULL) {
sprintf(pBueffel, "restore %s", syncFile);
snprintf(pBueffel,sizeof(pBueffel)-1, "restore %s", syncFile);
} else {
strcpy(pBueffel, "restore");
}