From 496d3dc8ff9b96d1163f3b13fbb70b66cc9fb4f3 Mon Sep 17 00:00:00 2001 From: Tim Cava Date: Mon, 11 Nov 2013 21:29:16 +0000 Subject: [PATCH] Convert sprintf calls to snprintf. From pvaldes. git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@459 13b04d17-f746-0410-82c6-800466cd88b0 --- source/timer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/timer.c b/source/timer.c index f299d03..881794b 100644 --- a/source/timer.c +++ b/source/timer.c @@ -287,7 +287,7 @@ static void show_timer (char *command) time_left = BX_time_diff(current, tmp->time); if (time_left < 0) time_left = 0; - sprintf(buf, "%0.3f", time_left); + snprintf(buf, sizeof buf, "%0.3f", time_left); put_it("%s", convert_output_format(fget_string_var(FORMAT_TIMER_FSET), "%s %s %d %s %s", tmp->ref, buf, tmp->events, tmp->callback? "(internal callback)" : (tmp->command? tmp->command : ""), tmp->whom ? tmp->whom : empty_string )); } } @@ -467,7 +467,7 @@ TimerList *tmp; time_left = BX_time_diff(current, tmp->time); if (time_left < 0) time_left = 0.0; - sprintf(buf, "%0.3f", time_left); + snprintf(buf, sizeof buf, "%0.3f", time_left); malloc_sprintf(&out, "%s %d %d %d %d %s %s %s", tmp->ref, tmp->server, tmp->window, tmp->interval, tmp->events, buf, tmp->callback? "(internal callback)" : (tmp->command? tmp->command : ""), tmp->whom ? tmp->whom : empty_string ); return ref; }