From 1ada0efb54f324d1459f7f9cadf20861db606072 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Thu, 1 Nov 2007 13:29:06 +0000 Subject: [PATCH] don't check array's for null with switch_str_nil macro (MODAPP-44) git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6127 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/applications/mod_rss/mod_rss.c | 5 +++-- src/mod/applications/mod_voicemail/mod_voicemail.c | 10 +++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/mod/applications/mod_rss/mod_rss.c b/src/mod/applications/mod_rss/mod_rss.c index e1899b107d..b71d956d8e 100644 --- a/src/mod/applications/mod_rss/mod_rss.c +++ b/src/mod/applications/mod_rss/mod_rss.c @@ -24,6 +24,7 @@ * Contributor(s): * * Anthony Minessale II + * Bret McDanel * * * mod_rss.c -- RSS Browser @@ -323,7 +324,7 @@ SWITCH_STANDARD_APP(rss_function) goto finished; } } - if (!switch_strlen_zero(cmd)) { + if (*cmd != '\0') { int32_t i; char *p; @@ -482,7 +483,7 @@ SWITCH_STANDARD_APP(rss_function) if (status != SWITCH_STATUS_SUCCESS && status != SWITCH_STATUS_BREAK) { goto finished; } - if (!switch_strlen_zero(cmd)) { + if (*cmd != '\0') { switch (*cmd) { case '0': switch_set_flag(&dtb, SFLAG_INSTRUCT); diff --git a/src/mod/applications/mod_voicemail/mod_voicemail.c b/src/mod/applications/mod_voicemail/mod_voicemail.c index b7eb02ea75..0ee0d4e823 100644 --- a/src/mod/applications/mod_voicemail/mod_voicemail.c +++ b/src/mod/applications/mod_voicemail/mod_voicemail.c @@ -1262,7 +1262,7 @@ static void voicemail_check_main(switch_core_session_t *session, const char *pro sql = switch_mprintf("select count(*) from voicemail_prefs where user='%q' and domain = '%q'", myid, domain_name); vm_execute_sql_callback(profile, profile->mutex, sql, sql2str_callback, &cbt); switch_safe_free(sql); - if (switch_strlen_zero(msg_count) || !atoi(msg_count)) { + if (*msg_count == '\0' || !atoi(msg_count)) { sql = switch_mprintf("insert into voicemail_prefs values('%q','%q','','')", myid, domain_name); vm_execute_sql(profile, sql, profile->mutex); switch_safe_free(sql); @@ -1395,7 +1395,7 @@ static void voicemail_check_main(switch_core_session_t *session, const char *pro goto end; } - if (switch_strlen_zero(id_buf)) { + if (*id_buf == '\0') { continue; } else { myid = id_buf; @@ -1432,7 +1432,7 @@ static void voicemail_check_main(switch_core_session_t *session, const char *pro if (status != SWITCH_STATUS_SUCCESS) { goto end; } - if (switch_strlen_zero(pass_buf)) { + if (*pass_buf == '\0') { continue; } else { mypass = pass_buf; @@ -1656,13 +1656,13 @@ static switch_status_t voicemail_leave_main(switch_core_session_t *session, cons memset(buf, 0, sizeof(buf)); TRY_CODE(switch_ivr_play_file(session, NULL, cbt.name_path, &args)); } - if (switch_strlen_zero(buf)) { + if (*buf == '\0') { memset(buf, 0, sizeof(buf)); TRY_CODE(switch_ivr_phrase_macro(session, VM_PLAY_GREETING_MACRO, id, NULL, &args)); } } - if (!switch_strlen_zero(buf)) { + if (*buf != '\0') { if (!strcasecmp(buf, profile->main_menu_key)) { voicemail_check_main(session, profile_name, domain_name, id, 0); } else {