提交 d09e6c60 authored 作者: Marc Olivier Chouinard's avatar Marc Olivier Chouinard

switch_xml: snprintf size fix

上级 cd736a1c
...@@ -2761,7 +2761,7 @@ SWITCH_DECLARE(int) switch_xml_std_datetime_check(switch_xml_t xcond) { ...@@ -2761,7 +2761,7 @@ SWITCH_DECLARE(int) switch_xml_std_datetime_check(switch_xml_t xcond) {
if (time_match && xtod) { if (time_match && xtod) {
int test = (tm.tm_hour * 60 * 60) + (tm.tm_min * 60) + tm.tm_sec; int test = (tm.tm_hour * 60 * 60) + (tm.tm_min * 60) + tm.tm_sec;
char tmpdate[10]; char tmpdate[10];
switch_snprintf(tmpdate, 6, "%d:%d:%d", tm.tm_hour, tm.tm_min, tm.tm_sec); switch_snprintf(tmpdate, 10, "%d:%d:%d", tm.tm_hour, tm.tm_min, tm.tm_sec);
time_match = switch_tod_cmp(xtod, test); time_match = switch_tod_cmp(xtod, test);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG9, switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG9,
"XML DateTime Check: time of day[%s] =~ %s (%s)\n", tmpdate, xtod, time_match ? "PASS" : "FAIL"); "XML DateTime Check: time of day[%s] =~ %s (%s)\n", tmpdate, xtod, time_match ? "PASS" : "FAIL");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论