Update of /usr/cvsroot/asterisk/res
In directory mongoose.digium.com:/tmp/cvs-serv14656/res

Modified Files:
        res_agi.c res_config_odbc.c res_features.c res_monitor.c 
        res_musiconhold.c 
Log Message:
issue #5648


Index: res_agi.c
===================================================================
RCS file: /usr/cvsroot/asterisk/res/res_agi.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- res_agi.c   3 Nov 2005 21:25:57 -0000       1.53
+++ res_agi.c   8 Nov 2005 01:55:30 -0000       1.54
@@ -2009,7 +2009,7 @@
         char *stringp;
        AGI agi;
 
-       if (!data || ast_strlen_zero(data)) {
+       if (ast_strlen_zero(data)) {
                ast_log(LOG_WARNING, "AGI requires an argument (script)\n");
                return -1;
        }

Index: res_config_odbc.c
===================================================================
RCS file: /usr/cvsroot/asterisk/res/res_config_odbc.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- res_config_odbc.c   31 Oct 2005 21:31:25 -0000      1.31
+++ res_config_odbc.c   8 Nov 2005 01:55:31 -0000       1.32
@@ -168,7 +168,7 @@
                stringp = rowdata;
                while(stringp) {
                        chunk = strsep(&stringp, ";");
-                       if (chunk && !ast_strlen_zero(ast_strip(chunk))) {
+                       if (!ast_strlen_zero(ast_strip(chunk))) {
                                if (prev) {
                                        prev->next = ast_variable_new(coltitle, 
chunk);
                                        if (prev->next)
@@ -320,7 +320,7 @@
                        stringp = rowdata;
                        while(stringp) {
                                chunk = strsep(&stringp, ";");
-                               if (chunk && 
!ast_strlen_zero(ast_strip(chunk))) {
+                               if (!ast_strlen_zero(ast_strip(chunk))) {
                                        if (initfield && !strcmp(initfield, 
coltitle))
                                                ast_category_rename(cat, chunk);
                                        var = ast_variable_new(coltitle, chunk);

Index: res_features.c
===================================================================
RCS file: /usr/cvsroot/asterisk/res/res_features.c,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -d -r1.78 -r1.79
--- res_features.c      6 Nov 2005 21:00:35 -0000       1.78
+++ res_features.c      8 Nov 2005 01:55:31 -0000       1.79
@@ -183,7 +183,7 @@
 
        goto_on_transfer = pbx_builtin_getvar_helper(chan, "GOTO_ON_BLINDXFR");
 
-       if (goto_on_transfer && !ast_strlen_zero(goto_on_transfer) && (xferchan 
= ast_channel_alloc(0))) {
+       if (!ast_strlen_zero(goto_on_transfer) && (xferchan = 
ast_channel_alloc(0))) {
                char *x;
                struct ast_frame *f;
                
@@ -1002,7 +1002,7 @@
        }
 
 
-       if (dynamic_features && !ast_strlen_zero(dynamic_features)) {
+       if (!ast_strlen_zero(dynamic_features)) {
                char *tmp = ast_strdupa(dynamic_features);
                char *tok;
 
@@ -1868,7 +1868,7 @@
        char *id = astman_get_header(m,"ActionID");
        char idText[256] = "";
 
-       if (id && !ast_strlen_zero(id))
+       if (!ast_strlen_zero(id))
                snprintf(idText,256,"ActionID: %s\r\n",id);
 
        astman_send_ack(s, m, "Parked calls will follow");

Index: res_monitor.c
===================================================================
RCS file: /usr/cvsroot/asterisk/res/res_monitor.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- res_monitor.c       24 Oct 2005 20:12:06 -0000      1.39
+++ res_monitor.c       8 Nov 2005 01:55:31 -0000       1.40
@@ -123,7 +123,7 @@
                memset(monitor, 0, sizeof(struct ast_channel_monitor));
 
                /* Determine file names */
-               if (fname_base && !ast_strlen_zero(fname_base)) {
+               if (!ast_strlen_zero(fname_base)) {
                        int directory = strchr(fname_base, '/') ? 1 : 0;
                        /* try creating the directory just in case it doesn't 
exist */
                        if (directory) {
@@ -162,7 +162,7 @@
                monitor->stop = ast_monitor_stop;
 
                /* Determine file format */
-               if (format_spec && !ast_strlen_zero(format_spec)) {
+               if (!ast_strlen_zero(format_spec)) {
                        monitor->format = strdup(format_spec);
                } else {
                        monitor->format = strdup("wav");
@@ -264,12 +264,12 @@
 
                        /* Set the execute application */
                        execute = pbx_builtin_getvar_helper(chan, 
"MONITOR_EXEC");
-                       if (!execute || ast_strlen_zero(execute)) { 
+                       if (ast_strlen_zero(execute)) { 
                                execute = "nice -n 19 soxmix";
                                delfiles = 1;
                        } 
                        execute_args = pbx_builtin_getvar_helper(chan, 
"MONITOR_EXEC_ARGS");
-                       if (!execute_args || ast_strlen_zero(execute_args)) {
+                       if (ast_strlen_zero(execute_args)) {
                                execute_args = "";
                        }
                        
@@ -297,7 +297,7 @@
 int ast_monitor_change_fname(struct ast_channel *chan, const char *fname_base, 
int need_lock)
 {
        char tmp[256];
-       if ((!fname_base) || (ast_strlen_zero(fname_base))) {
+       if (ast_strlen_zero(fname_base)) {
                ast_log(LOG_WARNING, "Cannot change monitor filename of channel 
%s to null", chan->name);
                return -1;
        }
@@ -344,7 +344,7 @@
        int res = 0;
        
        /* Parse arguments. */
-       if (data && !ast_strlen_zero((char*)data)) {
+       if (!ast_strlen_zero((char*)data)) {
                arg = ast_strdupa((char*)data);
                format = arg;
                fname_base = strchr(arg, '|');
@@ -433,7 +433,7 @@
        char *mix = astman_get_header(m, "Mix");
        char *d;
        
-       if ((!name) || (ast_strlen_zero(name))) {
+       if (ast_strlen_zero(name)) {
                astman_send_error(s, m, "No channel specified");
                return 0;
        }
@@ -443,7 +443,7 @@
                return 0;
        }
 
-       if ((!fname) || (ast_strlen_zero(fname))) {
+       if (ast_strlen_zero(fname)) {
                /* No filename base specified, default to channel name as per 
CLI */
                fname = malloc (FILENAME_MAX);
                if (!fname) {
@@ -484,7 +484,7 @@
        struct ast_channel *c = NULL;
        char *name = astman_get_header(m, "Channel");
        int res;
-       if ((!name) || (ast_strlen_zero(name))) {
+       if (ast_strlen_zero(name)) {
                astman_send_error(s, m, "No channel specified");
                return 0;
        }
@@ -516,11 +516,11 @@
        struct ast_channel *c = NULL;
        char *name = astman_get_header(m, "Channel");
        char *fname = astman_get_header(m, "File");
-       if ((!name) || (ast_strlen_zero(name))) {
+       if (ast_strlen_zero(name)) {
                astman_send_error(s, m, "No channel specified");
                return 0;
        }
-       if ((!fname)||(ast_strlen_zero(fname))) {
+       if (ast_strlen_zero(fname)) {
                astman_send_error(s, m, "No filename specified");
                return 0;
        }

Index: res_musiconhold.c
===================================================================
RCS file: /usr/cvsroot/asterisk/res/res_musiconhold.c,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -d -r1.73 -r1.74
--- res_musiconhold.c   24 Oct 2005 20:12:06 -0000      1.73
+++ res_musiconhold.c   8 Nov 2005 01:55:31 -0000       1.74
@@ -361,7 +361,7 @@
                /* Look for extra arguments and add them to the list */
                strncpy(xargs, class->args, sizeof(xargs) - 1);
                argptr = xargs;
-               while (argptr && !ast_strlen_zero(argptr)) {
+               while (!ast_strlen_zero(argptr)) {
                        argv[argc++] = argptr;
                        argptr = strchr(argptr, ',');
                        if (argptr) {
@@ -373,7 +373,7 @@
                /* Format arguments for argv vector */
                strncpy(xargs, class->args, sizeof(xargs) - 1);
                argptr = xargs;
-               while (argptr && !ast_strlen_zero(argptr)) {
+               while (!ast_strlen_zero(argptr)) {
                        argv[argc++] = argptr;
                        argptr = strchr(argptr, ' ');
                        if (argptr) {
@@ -569,7 +569,7 @@
 
 static int moh2_exec(struct ast_channel *chan, void *data)
 {
-       if (!data || ast_strlen_zero(data)) {
+       if (ast_strlen_zero(data)) {
                ast_log(LOG_WARNING, "SetMusicOnHold requires an argument 
(class)\n");
                return -1;
        }
@@ -865,9 +865,9 @@
 {
        struct mohclass *mohclass;
 
-       if (!class || ast_strlen_zero(class))
+       if (ast_strlen_zero(class))
                class = chan->musicclass;
-       if (!class || ast_strlen_zero(class))
+       if (ast_strlen_zero(class))
                class = "default";
        ast_mutex_lock(&moh_lock);
        mohclass = get_mohbyname(class);

_______________________________________________
Asterisk-Cvs mailing list
[email protected]
http://lists.digium.com/mailman/listinfo/asterisk-cvs

Reply via email to