- 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

@@ -348,7 +348,7 @@ int VarlogWrapper(pVarLog self, SConnection * pCon,
}
self->fd = fopen(sub2, "w");
if (!self->fd) {
sprintf(pBueffel, "ERROR: failed to open temperature log file: %s",
snprintf(pBueffel,sizeof(pBueffel)-1, "ERROR: failed to open temperature log file: %s",
sub2);
SCWrite(pCon, pBueffel, eError);
return 0;
@@ -393,7 +393,7 @@ int VarlogWrapper(pVarLog self, SConnection * pCon,
eWarning);
return 0;
}
sprintf(pBueffel, "%s.Mean = %8.2f %s.StdDev = %8.2f",
snprintf(pBueffel,sizeof(pBueffel)-1, "%s.Mean = %8.2f %s.StdDev = %8.2f",
pVarName, fMean, pVarName, fStdDev);
SCWrite(pCon, pBueffel, eValue);
return 1;
@@ -414,7 +414,7 @@ int VarlogWrapper(pVarLog self, SConnection * pCon,
return 1;
} else { /* print */
sprintf(pBueffel, "%s.frequency = %d", pVarName,
snprintf(pBueffel,sizeof(pBueffel)-1, "%s.frequency = %d", pVarName,
(int) self->tFrequency);
SCWrite(pCon, pBueffel, eValue);
return 1;
@@ -462,7 +462,7 @@ int VarlogWrapper(pVarLog self, SConnection * pCon,
}
/* command not recognized */
else {
sprintf(pBueffel, "ERROR: %s no valid command to varlog", subcommand);
snprintf(pBueffel,sizeof(pBueffel)-1, "ERROR: %s no valid command to varlog", subcommand);
SCWrite(pCon, pBueffel, eError);
return 0;
}