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
This commit is contained in:
@@ -287,7 +287,7 @@ static void show_timer (char *command)
|
|||||||
time_left = BX_time_diff(current, tmp->time);
|
time_left = BX_time_diff(current, tmp->time);
|
||||||
if (time_left < 0)
|
if (time_left < 0)
|
||||||
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 ));
|
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);
|
time_left = BX_time_diff(current, tmp->time);
|
||||||
if (time_left < 0)
|
if (time_left < 0)
|
||||||
time_left = 0.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 );
|
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;
|
return ref;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user