[Asterisk-cvs] asterisk/funcs func_cdr.c, 1.8, 1.9 func_db.c, 1.8, 1.9 func_enum.c, 1.5, 1.6 func_env.c, 1.5, 1.6 func_groupcount.c, 1.8, 1.9 func_logic.c, 1.11, 1.12 func_math.c, 1.4, 1.5 func_md5.c, 1.7, 1.8 func_strings.c, 1.12, 1.13 func_uri.c, 1.3, 1.4

kpfleming kpfleming
Mon Nov 7 21:04:25 CST 2005


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

Modified Files:
	func_cdr.c func_db.c func_enum.c func_env.c func_groupcount.c 
	func_logic.c func_math.c func_md5.c func_strings.c func_uri.c 
Log Message:
issue #5648


Index: func_cdr.c
===================================================================
RCS file: /usr/cvsroot/asterisk/funcs/func_cdr.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- func_cdr.c	3 Nov 2005 21:19:10 -0000	1.8
+++ func_cdr.c	8 Nov 2005 01:55:30 -0000	1.9
@@ -45,7 +45,7 @@
 	char *argv[2];
 	int recursive = 0;
 
-	if (!data || ast_strlen_zero(data))
+	if (ast_strlen_zero(data))
 		return NULL;
 	
 	if (!chan->cdr)
@@ -73,7 +73,7 @@
 	char *argv[2];
 	int recursive = 0;
 
-	if (!data || ast_strlen_zero(data) || !value)
+	if (ast_strlen_zero(data) || !value)
 		return;
 	
 	mydata = ast_strdupa(data);

Index: func_db.c
===================================================================
RCS file: /usr/cvsroot/asterisk/funcs/func_db.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- func_db.c	3 Nov 2005 21:19:10 -0000	1.8
+++ func_db.c	8 Nov 2005 01:55:30 -0000	1.9
@@ -49,7 +49,7 @@
 	char *family;
 	char *key;
 
-	if (!data || ast_strlen_zero(data)) {
+	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "DB requires an argument, DB(<family>/<key>)\n");
 		return buf;
 	}
@@ -82,7 +82,7 @@
 	char *family;
 	char *key;
 
-	if (!data || ast_strlen_zero(data)) {
+	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "DB requires an argument, DB(<family>/<key>)=<value>\n");
 		return;
 	}
@@ -128,7 +128,7 @@
 	char *family;
 	char *key;
 
-	if (!data || ast_strlen_zero(data)) {
+	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "DB_EXISTS requires an argument, DB(<family>/<key>)\n");
 		return buf;
 	}

Index: func_enum.c
===================================================================
RCS file: /usr/cvsroot/asterisk/funcs/func_enum.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- func_enum.c	24 Oct 2005 20:12:06 -0000	1.5
+++ func_enum.c	8 Nov 2005 01:55:30 -0000	1.6
@@ -64,7 +64,7 @@
        int i = 0;
 
 
-       if (!data || ast_strlen_zero(data)) {
+       if (ast_strlen_zero(data)) {
                ast_log(LOG_WARNING, synopsis);
                return "";
        }
@@ -166,7 +166,7 @@
 
 	buf[0] = '\0';
 
-	if (!data || ast_strlen_zero(data)) {
+	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "TXTCIDNAME requires an argument (number)\n");
 		LOCAL_USER_REMOVE(u);
 		return buf;	

Index: func_env.c
===================================================================
RCS file: /usr/cvsroot/asterisk/funcs/func_env.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- func_env.c	24 Oct 2005 20:12:06 -0000	1.5
+++ func_env.c	8 Nov 2005 01:55:30 -0000	1.6
@@ -50,8 +50,8 @@
 
 static void builtin_function_env_write(struct ast_channel *chan, char *cmd, char *data, const char *value) 
 {
-	if (data && !ast_strlen_zero(data)) {
-		if (value && !ast_strlen_zero(value)) {
+	if (!ast_strlen_zero(data)) {
+		if (!ast_strlen_zero(value)) {
 			setenv(data, value, 1);
 		} else {
 			unsetenv(data);

Index: func_groupcount.c
===================================================================
RCS file: /usr/cvsroot/asterisk/funcs/func_groupcount.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- func_groupcount.c	24 Oct 2005 20:12:06 -0000	1.8
+++ func_groupcount.c	8 Nov 2005 01:55:30 -0000	1.9
@@ -102,7 +102,7 @@
 	char varname[256];
 	char *group;
 
-	if (data && !ast_strlen_zero(data)) {
+	if (!ast_strlen_zero(data)) {
 		snprintf(varname, sizeof(varname), "%s_%s", GROUP_CATEGORY_PREFIX, data);
 	} else {
 		ast_copy_string(varname, GROUP_CATEGORY_PREFIX, sizeof(varname));
@@ -119,7 +119,7 @@
 {
 	char grpcat[256];
 
-	if (data && !ast_strlen_zero(data)) {
+	if (!ast_strlen_zero(data)) {
 		snprintf(grpcat, sizeof(grpcat), "%s@%s", value, data);
 	} else {
 		ast_copy_string(grpcat, value, sizeof(grpcat));

Index: func_logic.c
===================================================================
RCS file: /usr/cvsroot/asterisk/funcs/func_logic.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- func_logic.c	24 Oct 2005 20:12:06 -0000	1.11
+++ func_logic.c	8 Nov 2005 01:55:30 -0000	1.12
@@ -64,7 +64,7 @@
 	iftrue = strsep(&data, ":");
 	iffalse = data;
 
-	if (!expr || ast_strlen_zero(expr) || !(iftrue || iffalse)) {
+	if (ast_strlen_zero(expr) || !(iftrue || iffalse)) {
 		ast_log(LOG_WARNING, "Syntax IFTIME(<timespec>?[<true>][:<false>])\n");
 		return NULL;
 	}
@@ -104,7 +104,7 @@
 	iftrue = strsep(&data, ":");
 	iffalse = data;
 
-	if (!expr || ast_strlen_zero(expr) || !(iftrue || iffalse)) {
+	if (ast_strlen_zero(expr) || !(iftrue || iffalse)) {
 		ast_log(LOG_WARNING, "Syntax IF(<expr>?[<true>][:<false>])\n");
 		return NULL;
 	}
@@ -136,7 +136,7 @@
 	varname = strsep(&data, "=");
 	val = data;
 
-	if (!varname || ast_strlen_zero(varname) || !val) {
+	if (ast_strlen_zero(varname) || !val) {
 		ast_log(LOG_WARNING, "Syntax SET(<varname>=[<value>])\n");
 		return NULL;
 	}

Index: func_math.c
===================================================================
RCS file: /usr/cvsroot/asterisk/funcs/func_math.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- func_math.c	3 Nov 2005 21:19:10 -0000	1.4
+++ func_math.c	8 Nov 2005 01:55:30 -0000	1.5
@@ -78,7 +78,7 @@
 
 	char *mvalue1, *mvalue2=NULL, *mtype_of_result;
 		
-	if (!data || ast_strlen_zero(data)) {
+	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "Syntax: Math(<number1><op><number 2>[,<type_of_result>]) - missing argument!\n");
 		return NULL;
 	}

Index: func_md5.c
===================================================================
RCS file: /usr/cvsroot/asterisk/funcs/func_md5.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- func_md5.c	3 Nov 2005 21:19:10 -0000	1.7
+++ func_md5.c	8 Nov 2005 01:55:30 -0000	1.8
@@ -40,7 +40,7 @@
 {
 	char md5[33];
 
-	if (!data || ast_strlen_zero(data)) {
+	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "Syntax: MD5(<data>) - missing argument!\n");
 		return NULL;
 	}

Index: func_strings.c
===================================================================
RCS file: /usr/cvsroot/asterisk/funcs/func_strings.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- func_strings.c	24 Oct 2005 20:12:06 -0000	1.12
+++ func_strings.c	8 Nov 2005 01:55:30 -0000	1.13
@@ -160,7 +160,7 @@
 	epoch = strsep(&format, "|");
 	timezone = strsep(&format, "|");
 
-	if (!epoch || ast_strlen_zero(epoch) || !sscanf(epoch, "%ld", &epochi)) {
+	if (ast_strlen_zero(epoch) || !sscanf(epoch, "%ld", &epochi)) {
 		struct timeval tv = ast_tvnow();
 		epochi = tv.tv_sec;
 	}
@@ -193,7 +193,7 @@
 {
 	memset(buf, 0, len);
 
-	if (!data || ast_strlen_zero(data)) {
+	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "EVAL requires an argument: EVAL(<string>)\n");
 		return buf;
 	}

Index: func_uri.c
===================================================================
RCS file: /usr/cvsroot/asterisk/funcs/func_uri.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- func_uri.c	24 Oct 2005 20:12:06 -0000	1.3
+++ func_uri.c	8 Nov 2005 01:55:30 -0000	1.4
@@ -45,7 +45,7 @@
 {
 	char uri[BUFSIZ];
 
-	if (!data || ast_strlen_zero(data)) {
+	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "Syntax: URIENCODE(<data>) - missing argument!\n");
 		return NULL;
 	}
@@ -59,7 +59,7 @@
 /*!\brief builtin_function_uridecode: Decode URI according to RFC 2396 */
 static char *builtin_function_uridecode(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len) 
 {
-	if (!data || ast_strlen_zero(data)) {
+	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "Syntax: URIDECODE(<data>) - missing argument!\n");
 		return NULL;
 	}




More information about the svn-commits mailing list