1458. [cleanup] sprintf() -> snprintf().

This commit is contained in:
Mark Andrews
2003-04-11 07:25:31 +00:00
parent 935000aa6e
commit 806c235ecf
16 changed files with 83 additions and 69 deletions

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: t_api.c,v 1.49 2002/08/27 04:53:43 marka Exp $ */
/* $Id: t_api.c,v 1.50 2003/04/11 07:25:31 marka Exp $ */
#include <config.h>
@@ -253,7 +253,7 @@ main(int argc, char **argv) {
* Output start stanza to journal.
*/
sprintf(T_buf, "%s:", argv[0]);
snprintf(T_buf, sizeof(T_buf), "%s:", argv[0]);
len = strlen(T_buf);
(void) t_getdate(T_buf + len, T_BIGBUF - len);
t_putinfo("S", T_buf);
@@ -334,7 +334,7 @@ main(int argc, char **argv) {
++tnum;
}
sprintf(T_buf, "%s:", argv[0]);
snprintf(T_buf, sizeof(T_buf), "%s:", argv[0]);
len = strlen(T_buf);
(void) t_getdate(T_buf + len, T_BIGBUF - len);
t_putinfo("E", T_buf);
@@ -353,7 +353,7 @@ t_assert(const char *component, int anum, int class, const char *what, ...) {
* Format text to a buffer.
*/
va_start(args, what);
(void)vsprintf(T_buf, what, args);
(void)vsnprintf(T_buf, sizeof(T_buf), what, args);
va_end(args);
(void)t_putinfo("A", T_buf);
@@ -365,7 +365,7 @@ t_info(const char *format, ...) {
va_list args;
va_start(args, format);
(void) vsprintf(T_buf, format, args);
(void) vsnprintf(T_buf, sizeof(T_buf), format, args);
va_end(args);
(void) t_putinfo("I", T_buf);
}