[Asterisk-cvs] asterisk/res res_musiconhold.c,1.26,1.27

citats at lists.digium.com citats at lists.digium.com
Fri May 28 15:29:31 CDT 2004


Update of /usr/cvsroot/asterisk/res
In directory mongoose.digium.com:/home/citats/cvs/asterisk/res

Modified Files:
	res_musiconhold.c 
Log Message:
Use ast_strlen_zero in res_musiconhold.c

Index: res_musiconhold.c
===================================================================
RCS file: /usr/cvsroot/asterisk/res/res_musiconhold.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- res_musiconhold.c	15 May 2004 15:40:08 -0000	1.26
+++ res_musiconhold.c	28 May 2004 19:44:33 -0000	1.27
@@ -23,6 +23,7 @@
 #include <asterisk/channel_pvt.h>
 #include <asterisk/musiconhold.h>
 #include <asterisk/config.h>
+#include <asterisk/utils.h>
 #include <stdlib.h>
 #include <errno.h>
 #include <unistd.h>
@@ -138,7 +139,7 @@
 	/* Look for extra arguments and add them to the list */
 	strncpy(xargs, class->miscargs, sizeof(xargs) - 1);
 	argptr = xargs;
-	while(argptr && strlen(argptr)) {
+	while(argptr && !ast_strlen_zero(argptr)) {
 		argv[argc++] = argptr;
 		argptr = strchr(argptr, ',');
 		if (argptr) {
@@ -333,7 +334,7 @@
 
 static int moh2_exec(struct ast_channel *chan, void *data)
 {
-	if (!data || !strlen(data)) {
+	if (!data || ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "SetMusicOnHold requires an argument (class)\n");
 		return -1;
 	}
@@ -544,9 +545,9 @@
 
 int ast_moh_start(struct ast_channel *chan, char *class)
 {
-	if (!class || !strlen(class))
+	if (!class || ast_strlen_zero(class))
 		class = chan->musicclass;
-	if (!class || !strlen(class))
+	if (!class || ast_strlen_zero(class))
 		class = "default";
 	return ast_activate_generator(chan, &mohgen, class);
 }




More information about the svn-commits mailing list