提交 1ada0efb authored 作者: Michael Jerris's avatar Michael Jerris

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
上级 6ae43f95
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
* Contributor(s): * Contributor(s):
* *
* Anthony Minessale II <anthmct@yahoo.com> * Anthony Minessale II <anthmct@yahoo.com>
* Bret McDanel <trixter AT 0xdecafbad.com>
* *
* *
* mod_rss.c -- RSS Browser * mod_rss.c -- RSS Browser
...@@ -323,7 +324,7 @@ SWITCH_STANDARD_APP(rss_function) ...@@ -323,7 +324,7 @@ SWITCH_STANDARD_APP(rss_function)
goto finished; goto finished;
} }
} }
if (!switch_strlen_zero(cmd)) { if (*cmd != '\0') {
int32_t i; int32_t i;
char *p; char *p;
...@@ -482,7 +483,7 @@ SWITCH_STANDARD_APP(rss_function) ...@@ -482,7 +483,7 @@ SWITCH_STANDARD_APP(rss_function)
if (status != SWITCH_STATUS_SUCCESS && status != SWITCH_STATUS_BREAK) { if (status != SWITCH_STATUS_SUCCESS && status != SWITCH_STATUS_BREAK) {
goto finished; goto finished;
} }
if (!switch_strlen_zero(cmd)) { if (*cmd != '\0') {
switch (*cmd) { switch (*cmd) {
case '0': case '0':
switch_set_flag(&dtb, SFLAG_INSTRUCT); switch_set_flag(&dtb, SFLAG_INSTRUCT);
......
...@@ -1262,7 +1262,7 @@ static void voicemail_check_main(switch_core_session_t *session, const char *pro ...@@ -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); 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); vm_execute_sql_callback(profile, profile->mutex, sql, sql2str_callback, &cbt);
switch_safe_free(sql); 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); sql = switch_mprintf("insert into voicemail_prefs values('%q','%q','','')", myid, domain_name);
vm_execute_sql(profile, sql, profile->mutex); vm_execute_sql(profile, sql, profile->mutex);
switch_safe_free(sql); switch_safe_free(sql);
...@@ -1395,7 +1395,7 @@ static void voicemail_check_main(switch_core_session_t *session, const char *pro ...@@ -1395,7 +1395,7 @@ static void voicemail_check_main(switch_core_session_t *session, const char *pro
goto end; goto end;
} }
if (switch_strlen_zero(id_buf)) { if (*id_buf == '\0') {
continue; continue;
} else { } else {
myid = id_buf; myid = id_buf;
...@@ -1432,7 +1432,7 @@ static void voicemail_check_main(switch_core_session_t *session, const char *pro ...@@ -1432,7 +1432,7 @@ static void voicemail_check_main(switch_core_session_t *session, const char *pro
if (status != SWITCH_STATUS_SUCCESS) { if (status != SWITCH_STATUS_SUCCESS) {
goto end; goto end;
} }
if (switch_strlen_zero(pass_buf)) { if (*pass_buf == '\0') {
continue; continue;
} else { } else {
mypass = pass_buf; mypass = pass_buf;
...@@ -1656,13 +1656,13 @@ static switch_status_t voicemail_leave_main(switch_core_session_t *session, cons ...@@ -1656,13 +1656,13 @@ static switch_status_t voicemail_leave_main(switch_core_session_t *session, cons
memset(buf, 0, sizeof(buf)); memset(buf, 0, sizeof(buf));
TRY_CODE(switch_ivr_play_file(session, NULL, cbt.name_path, &args)); 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)); memset(buf, 0, sizeof(buf));
TRY_CODE(switch_ivr_phrase_macro(session, VM_PLAY_GREETING_MACRO, id, NULL, &args)); 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)) { if (!strcasecmp(buf, profile->main_menu_key)) {
voicemail_check_main(session, profile_name, domain_name, id, 0); voicemail_check_main(session, profile_name, domain_name, id, 0);
} else { } else {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论