check return value for es_say_general_count

This commit is contained in:
Michael Jerris 2014-04-30 16:43:35 -04:00
parent ef18915ca5
commit 6add88b43f
1 changed files with 7 additions and 2 deletions

View File

@ -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 {