mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-02-04 18:27:36 +00:00
check return value for es_say_general_count
This commit is contained in:
parent
ef18915ca5
commit
6add88b43f
@ -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 sbuf[16] = ""; /* enough for 999,999,999,999.99 (w/o the commas or leading $) */
|
||||||
char *dollars = NULL;
|
char *dollars = NULL;
|
||||||
char *cents = NULL;
|
char *cents = NULL;
|
||||||
|
switch_status_t status;
|
||||||
|
|
||||||
if (strlen(tosay) > 15 || !switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1)) {
|
if (strlen(tosay) > 15 || !switch_strip_nonnumerics(tosay, sbuf, sizeof(sbuf)-1)) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
|
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 */
|
/* 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) {
|
if (atoi(dollars) == 1) {
|
||||||
say_file("currency/dollar.wav");
|
say_file("currency/dollar.wav");
|
||||||
} else {
|
} else {
|
||||||
@ -403,7 +406,9 @@ static switch_status_t es_say_money(switch_core_session_t *session, char *tosay,
|
|||||||
|
|
||||||
/* Say cents */
|
/* Say cents */
|
||||||
if (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) {
|
if (atoi(cents) == 1) {
|
||||||
say_file("currency/cent.wav");
|
say_file("currency/cent.wav");
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user