]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
new macro
authorMichael Jerris <mike@jerris.com>
Fri, 22 Aug 2008 17:14:19 +0000 (17:14 +0000)
committerMichael Jerris <mike@jerris.com>
Fri, 22 Aug 2008 17:14:19 +0000 (17:14 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9349 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_utils.h
src/mod/applications/mod_voicemail/mod_voicemail.c

index 157254814996d849802b4fb98798463fea8ec8db..e2b6cdda0420dbe73666c7c783f924467acdc42d 100644 (file)
@@ -59,7 +59,8 @@ SWITCH_BEGIN_EXTERN_C
   \param s the string to test
   \return true value if the string is NULL or zero length
 */
-#define switch_strlen_zero(s) (!s || *s == '\0')
+#define switch_strlen_zero(s) (!s || *(s) == '\0')
+#define switch_strlen_zero_buf(s) (*(s) == '\0')
 static inline switch_bool_t switch_is_moh(const char *s)
 {
        if (switch_strlen_zero(s) || !strcasecmp(s, "silence") || !strcasecmp(s, "indicate_hold")) {
index 7003314c0e30a37c4738e156a3c2b2730d678a16..7314aca40afccc52a03f7f10dbb490c008984cf9 100644 (file)
@@ -1403,7 +1403,7 @@ static void voicemail_check_main(switch_core_session_t *session, const char *pro
                                        switch_snprintf(msg_count, sizeof(msg_count), "%d:urgent-new", total_new_urgent_messages);
                                        TRY_CODE(switch_ivr_phrase_macro(session, VM_MESSAGE_COUNT_MACRO, msg_count, NULL, &args));
                                        informed++;
-                                       if ((*global_buf =! '\0')) {
+                                       if (!switch_strlen_zero_buf(global_buf) {
                                                vm_check_state = VM_CHECK_MENU;
                                                continue;
                                        }
@@ -1412,7 +1412,7 @@ static void voicemail_check_main(switch_core_session_t *session, const char *pro
                                        switch_snprintf(msg_count, sizeof(msg_count), "%d:new", total_new_messages);
                                        TRY_CODE(switch_ivr_phrase_macro(session, VM_MESSAGE_COUNT_MACRO, msg_count, NULL, &args));
                                        informed++;
-                                       if ((*global_buf =! '\0')) {
+                                       if (!switch_strlen_zero_buf(global_buf) {
                                                vm_check_state = VM_CHECK_MENU;
                                                continue;
                                        }
@@ -1621,7 +1621,7 @@ static void voicemail_check_main(switch_core_session_t *session, const char *pro
                                char input[10] = "";
                                char key_buf[80] = "";
                                play_msg_type = MSG_NONE;
-                               if (!switch_strlen_zero(global_buf)) {
+                               if (!switch_strlen_zero_buf(global_buf)) {
                                        switch_set_string(input, global_buf);
                                        *global_buf = '\0';
                                        status = SWITCH_STATUS_SUCCESS;