From 6a90d335fc2fbc68ebd7ec0775735d5c39e425be Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Wed, 12 Dec 2007 22:38:01 +0000 Subject: [PATCH] don't hide status in macro, use switch_snprintf to get null terminated string. git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6709 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/say/mod_say_de/mod_say_de.c | 16 ++++++++-------- src/mod/say/mod_say_en/mod_say_en.c | 12 ++++++------ src/mod/say/mod_say_es/mod_say_es.c | 16 ++++++++-------- src/mod/say/mod_say_fr/mod_say_fr.c | 16 ++++++++-------- src/mod/say/mod_say_it/mod_say_it.c | 16 ++++++++-------- src/mod/say/mod_say_nl/mod_say_nl.c | 16 ++++++++-------- 6 files changed, 46 insertions(+), 46 deletions(-) diff --git a/src/mod/say/mod_say_de/mod_say_de.c b/src/mod/say/mod_say_de/mod_say_de.c index 674d3b24c7..250c2da7ee 100644 --- a/src/mod/say/mod_say_de/mod_say_de.c +++ b/src/mod/say/mod_say_de/mod_say_de.c @@ -53,18 +53,18 @@ SWITCH_MODULE_DEFINITION(mod_say_de, mod_say_de_load, NULL, NULL); #define say_num(num, t) { \ char tmp[80];\ - switch_status_t status;\ - snprintf(tmp, sizeof(tmp), "%u", (unsigned)num); \ - if ((status = de_say_general_count(session, tmp, SST_ITEMS, t, args)) != SWITCH_STATUS_SUCCESS) {\ - return status;\ + switch_status_t tstatus;\ + switch_snprintf(tmp, sizeof(tmp), "%u", (unsigned)num); \ + if ((tstatus = de_say_general_count(session, tmp, SST_ITEMS, t, args)) != SWITCH_STATUS_SUCCESS) {\ + return tstatus;\ }}\ #define say_file(...) {\ char tmp[80];\ - switch_status_t status;\ - snprintf(tmp, sizeof(tmp), __VA_ARGS__);\ - if ((status = switch_ivr_play_file(session, NULL, tmp, args)) != SWITCH_STATUS_SUCCESS){ \ - return status;\ + switch_status_t tstatus;\ + switch_snprintf(tmp, sizeof(tmp), __VA_ARGS__);\ + if ((tstatus = switch_ivr_play_file(session, NULL, tmp, args)) != SWITCH_STATUS_SUCCESS){ \ + return tstatus;\ }\ if (!switch_channel_ready(switch_core_session_get_channel(session))) {\ return SWITCH_STATUS_FALSE;\ diff --git a/src/mod/say/mod_say_en/mod_say_en.c b/src/mod/say/mod_say_en/mod_say_en.c index 8e789041de..c78b8eb25f 100644 --- a/src/mod/say/mod_say_en/mod_say_en.c +++ b/src/mod/say/mod_say_en/mod_say_en.c @@ -53,18 +53,18 @@ SWITCH_MODULE_DEFINITION(mod_say_en, mod_say_en_load, NULL, NULL); #define say_num(num, t) { \ char tmp[80];\ - switch_status_t status;\ + switch_status_t tstatus;\ switch_snprintf(tmp, sizeof(tmp), "%u", (unsigned)num); \ - if ((status = en_say_general_count(session, tmp, SST_ITEMS, t, args)) != SWITCH_STATUS_SUCCESS) {\ - return status;\ + if ((tstatus = en_say_general_count(session, tmp, SST_ITEMS, t, args)) != SWITCH_STATUS_SUCCESS) {\ + return tstatus;\ }}\ #define say_file(...) {\ char tmp[80];\ - switch_status_t status;\ + switch_status_t tstatus;\ switch_snprintf(tmp, sizeof(tmp), __VA_ARGS__);\ - if ((status = switch_ivr_play_file(session, NULL, tmp, args)) != SWITCH_STATUS_SUCCESS){ \ - return status;\ + if ((tstatus = switch_ivr_play_file(session, NULL, tmp, args)) != SWITCH_STATUS_SUCCESS){ \ + return tstatus;\ }\ if (!switch_channel_ready(switch_core_session_get_channel(session))) {\ return SWITCH_STATUS_FALSE;\ diff --git a/src/mod/say/mod_say_es/mod_say_es.c b/src/mod/say/mod_say_es/mod_say_es.c index 4d1dcd017a..4e0502cb20 100644 --- a/src/mod/say/mod_say_es/mod_say_es.c +++ b/src/mod/say/mod_say_es/mod_say_es.c @@ -53,18 +53,18 @@ SWITCH_MODULE_DEFINITION(mod_say_es, mod_say_es_load, NULL, NULL); #define say_num(num, t) { \ char tmp[80];\ - switch_status_t status;\ - snprintf(tmp, sizeof(tmp), "%u", (unsigned)num); \ - if ((status = es_say_general_count(session, tmp, SST_ITEMS, t, args)) != SWITCH_STATUS_SUCCESS) {\ - return status;\ + switch_status_t tstatus;\ + switch_snprintf(tmp, sizeof(tmp), "%u", (unsigned)num); \ + if ((tstatus = es_say_general_count(session, tmp, SST_ITEMS, t, args)) != SWITCH_STATUS_SUCCESS) {\ + return tstatus;\ }}\ #define say_file(...) {\ char tmp[80];\ - switch_status_t status;\ - snprintf(tmp, sizeof(tmp), __VA_ARGS__);\ - if ((status = switch_ivr_play_file(session, NULL, tmp, args)) != SWITCH_STATUS_SUCCESS){ \ - return status;\ + switch_status_t tstatus;\ + switch_snprintf(tmp, sizeof(tmp), __VA_ARGS__);\ + if ((tstatus = switch_ivr_play_file(session, NULL, tmp, args)) != SWITCH_STATUS_SUCCESS){ \ + return tstatus;\ }\ if (!switch_channel_ready(switch_core_session_get_channel(session))) {\ return SWITCH_STATUS_FALSE;\ diff --git a/src/mod/say/mod_say_fr/mod_say_fr.c b/src/mod/say/mod_say_fr/mod_say_fr.c index 955d867ef9..f6d7c5cc6e 100644 --- a/src/mod/say/mod_say_fr/mod_say_fr.c +++ b/src/mod/say/mod_say_fr/mod_say_fr.c @@ -53,18 +53,18 @@ SWITCH_MODULE_DEFINITION(mod_say_fr, mod_say_fr_load, NULL, NULL); #define say_num(num, t) { \ char tmp[80];\ - switch_status_t status;\ - snprintf(tmp, sizeof(tmp), "%u", (unsigned)num); \ - if ((status = fr_say_general_count(session, tmp, SST_ITEMS, t, args)) != SWITCH_STATUS_SUCCESS) {\ - return status;\ + switch_status_t tstatus;\ + switch_snprintf(tmp, sizeof(tmp), "%u", (unsigned)num); \ + if ((tstatus = fr_say_general_count(session, tmp, SST_ITEMS, t, args)) != SWITCH_STATUS_SUCCESS) {\ + return tstatus;\ }}\ #define say_file(...) {\ char tmp[80];\ - switch_status_t status;\ - snprintf(tmp, sizeof(tmp), __VA_ARGS__);\ - if ((status = switch_ivr_play_file(session, NULL, tmp, args)) != SWITCH_STATUS_SUCCESS){ \ - return status;\ + switch_status_t tstatus;\ + switch_snprintf(tmp, sizeof(tmp), __VA_ARGS__);\ + if ((tstatus = switch_ivr_play_file(session, NULL, tmp, args)) != SWITCH_STATUS_SUCCESS){ \ + return tstatus;\ }\ if (!switch_channel_ready(switch_core_session_get_channel(session))) {\ return SWITCH_STATUS_FALSE;\ diff --git a/src/mod/say/mod_say_it/mod_say_it.c b/src/mod/say/mod_say_it/mod_say_it.c index 2281752151..53764f0c50 100644 --- a/src/mod/say/mod_say_it/mod_say_it.c +++ b/src/mod/say/mod_say_it/mod_say_it.c @@ -53,18 +53,18 @@ SWITCH_MODULE_DEFINITION(mod_say_it, mod_say_it_load, NULL, NULL); #define say_num(num, t) { \ char tmp[80];\ - switch_status_t status;\ - snprintf(tmp, sizeof(tmp), "%u", (unsigned)num); \ - if ((status = it_say_general_count(session, tmp, SST_ITEMS, t, args)) != SWITCH_STATUS_SUCCESS) {\ - return status;\ + switch_status_t tstatus;\ + switch_snprintf(tmp, sizeof(tmp), "%u", (unsigned)num); \ + if ((tstatus = it_say_general_count(session, tmp, SST_ITEMS, t, args)) != SWITCH_STATUS_SUCCESS) {\ + return tstatus;\ }}\ #define say_file(...) {\ char tmp[80];\ - switch_status_t status;\ - snprintf(tmp, sizeof(tmp), __VA_ARGS__);\ - if ((status = switch_ivr_play_file(session, NULL, tmp, args)) != SWITCH_STATUS_SUCCESS){ \ - return status;\ + switch_status_t tstatus;\ + switch_snprintf(tmp, sizeof(tmp), __VA_ARGS__);\ + if ((tstatus = switch_ivr_play_file(session, NULL, tmp, args)) != SWITCH_STATUS_SUCCESS){ \ + return tstatus;\ }\ if (!switch_channel_ready(switch_core_session_get_channel(session))) {\ return SWITCH_STATUS_FALSE;\ diff --git a/src/mod/say/mod_say_nl/mod_say_nl.c b/src/mod/say/mod_say_nl/mod_say_nl.c index 82c5d491f1..8c0b6412cb 100644 --- a/src/mod/say/mod_say_nl/mod_say_nl.c +++ b/src/mod/say/mod_say_nl/mod_say_nl.c @@ -53,18 +53,18 @@ SWITCH_MODULE_DEFINITION(mod_say_nl, mod_say_nl_load, NULL, NULL); #define say_num(num, t) { \ char tmp[80];\ - switch_status_t status;\ - snprintf(tmp, sizeof(tmp), "%u", (unsigned)num); \ - if ((status = nl_say_general_count(session, tmp, SST_ITEMS, t, args)) != SWITCH_STATUS_SUCCESS) {\ - return status;\ + switch_status_t tstatus;\ + switch_snprintf(tmp, sizeof(tmp), "%u", (unsigned)num); \ + if ((tstatus = nl_say_general_count(session, tmp, SST_ITEMS, t, args)) != SWITCH_STATUS_SUCCESS) {\ + return tstatus;\ }}\ #define say_file(...) {\ char tmp[80];\ - switch_status_t status;\ - snprintf(tmp, sizeof(tmp), __VA_ARGS__);\ - if ((status = switch_ivr_play_file(session, NULL, tmp, args)) != SWITCH_STATUS_SUCCESS){ \ - return status;\ + switch_status_t tstatus;\ + switch_snprintf(tmp, sizeof(tmp), __VA_ARGS__);\ + if ((tstatus = switch_ivr_play_file(session, NULL, tmp, args)) != SWITCH_STATUS_SUCCESS){ \ + return tstatus;\ }\ if (!switch_channel_ready(switch_core_session_get_channel(session))) {\ return SWITCH_STATUS_FALSE;\