1458.   [cleanup]       sprintf() -> snprintf().
This commit is contained in:
Mark Andrews
2003-08-27 07:22:41 +00:00
parent f046c1a3af
commit dd8e7329b1
16 changed files with 90 additions and 76 deletions

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: t_api.c,v 1.48.2.1.2.1 2003/08/20 05:33:18 marka Exp $ */
/* $Id: t_api.c,v 1.48.2.1.2.2 2003/08/27 07:22:41 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);
}