[Freeswitch-svn] [commit] r6127 - in freeswitch/trunk/src/mod/applications: mod_rss mod_voicemail

Freeswitch SVN mikej at freeswitch.org
Thu Nov 1 09:29:06 EDT 2007


Author: mikej
Date: Thu Nov  1 09:29:06 2007
New Revision: 6127

Modified:
   freeswitch/trunk/src/mod/applications/mod_rss/mod_rss.c
   freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c

Log:
don't check array's for null with switch_str_nil macro (MODAPP-44)

Modified: freeswitch/trunk/src/mod/applications/mod_rss/mod_rss.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_rss/mod_rss.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_rss/mod_rss.c	Thu Nov  1 09:29:06 2007
@@ -24,6 +24,7 @@
  * Contributor(s):
  * 
  * Anthony Minessale II <anthmct at yahoo.com>
+ * Bret McDanel <trixter AT 0xdecafbad.com>
  *
  *
  * mod_rss.c -- RSS Browser
@@ -323,7 +324,7 @@
 				goto finished;
 			}
 		}
-		if (!switch_strlen_zero(cmd)) {
+		if (*cmd != '\0') {
 			int32_t i;
 			char *p;
 
@@ -482,7 +483,7 @@
 			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);

Modified: freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c	Thu Nov  1 09:29:06 2007
@@ -1262,7 +1262,7 @@
                 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 @@
                         goto end;
                     }
 
-                    if (switch_strlen_zero(id_buf)) {
+                    if (*id_buf == '\0') {
                         continue;
                     } else {
                         myid = id_buf;
@@ -1432,7 +1432,7 @@
                         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 @@
             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 {



More information about the Freeswitch-svn mailing list