提交 6add88b4 authored 作者: Michael Jerris's avatar Michael Jerris

check return value for es_say_general_count

上级 ef18915c
......@@ -364,6 +364,7 @@ static switch_status_t es_say_money(switch_core_session_t *session, char *tosay,
char sbuf[16] = ""; /* enough for 999,999,999,999.99 (w/o the commas or leading $) */
char *dollars = NULL;
char *cents = NULL;
switch_status_t status;
if (strlen(tosay) > 15 || !switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
......@@ -391,7 +392,9 @@ static switch_status_t es_say_money(switch_core_session_t *session, char *tosay,
}
/* Say dollar amount */
es_say_general_count(session, dollars, say_args, args);
if ((status = es_say_general_count(session, dollars, say_args, args)) != SWITCH_STATUS_SUCCESS) {
return status;
}
if (atoi(dollars) == 1) {
say_file("currency/dollar.wav");
} else {
......@@ -403,7 +406,9 @@ static switch_status_t es_say_money(switch_core_session_t *session, char *tosay,
/* Say cents */
if (cents) {
es_say_general_count(session, cents, say_args, args);
if ((status = es_say_general_count(session, cents, say_args, args)) != SWITCH_STATUS_SUCCESS) {
return status;
}
if (atoi(cents) == 1) {
say_file("currency/cent.wav");
} else {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论