[Asterisk-cvs] asterisk acl.c, 1.54, 1.55 app.c, 1.73, 1.74 file.c, 1.74, 1.75 pbx.c, 1.271, 1.272

kpfleming kpfleming
Wed Sep 7 17:01:11 CDT 2005


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

Modified Files:
	acl.c app.c file.c pbx.c 
Log Message:
remove useless buffer initializations (issue #5134)
convert pbx_dundi to use ast_copy_string) (issue #5134)


Index: acl.c
===================================================================
RCS file: /usr/cvsroot/asterisk/acl.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -r1.54 -r1.55
--- acl.c	14 Aug 2005 03:16:06 -0000	1.54
+++ acl.c	7 Sep 2005 21:01:30 -0000	1.55
@@ -127,7 +127,7 @@
 {
 	struct ast_ha *ha = malloc(sizeof(struct ast_ha));
 	char *nm = "255.255.255.255";
-	char tmp[256] = "";
+	char tmp[256];
 	struct ast_ha *prev = NULL;
 	struct ast_ha *ret;
 	int x, z;

Index: app.c
===================================================================
RCS file: /usr/cvsroot/asterisk/app.c,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -d -r1.73 -r1.74
--- app.c	30 Aug 2005 02:12:09 -0000	1.73
+++ app.c	7 Sep 2005 21:01:31 -0000	1.74
@@ -261,8 +261,8 @@
 
 int ast_dtmf_stream(struct ast_channel *chan,struct ast_channel *peer,char *digits,int between) 
 {
-	char *ptr=NULL;
-	int res=0;
+	char *ptr;
+	int res = 0;
 	struct ast_frame f;
 	if (!between)
 		between = 100;
@@ -378,7 +378,7 @@
 int ast_linear_stream(struct ast_channel *chan, const char *filename, int fd, int allowoverride)
 {
 	struct linear_state *lin;
-	char tmpf[256] = "";
+	char tmpf[256];
 	int res = -1;
 	int autoclose = 0;
 	if (fd < 0) {
@@ -411,11 +411,11 @@
 			   const char *stop, const char *pause,
 			   const char *restart, int skipms) 
 {
-	long elapsed = 0,last_elapsed =0;
-	char *breaks=NULL;
-	char *end=NULL;
-	int blen=2;
-	int res=0;
+	long elapsed = 0, last_elapsed = 0;
+	char *breaks = NULL;
+	char *end = NULL;
+	int blen = 2;
+	int res;
 
 	if (stop)
 		blen += strlen(stop);
@@ -440,7 +440,6 @@
 	if (chan)
 		ast_stopstream(chan);
 
-
 	if (file) {
 		if ((end = strchr(file,':'))) {
 			if (!strcasecmp(end, ":end")) {
@@ -985,7 +984,7 @@
 int ast_app_group_split_group(char *data, char *group, int group_max, char *category, int category_max)
 {
 	int res=0;
-	char tmp[256] = "";
+	char tmp[256];
 	char *grp=NULL, *cat=NULL;
 
 	if (data && !ast_strlen_zero(data)) {
@@ -1030,7 +1029,7 @@
 	struct ast_channel *chan;
 	int count = 0;
 	char *test;
-	char cat[80] = "";
+	char cat[80];
 	char *s;
 
 	if (group == NULL || ast_strlen_zero(group))
@@ -1056,7 +1055,7 @@
 	struct ast_channel *chan;
 	int count = 0;
 	char *test;
-	char cat[80] = "";
+	char cat[80];
 	char *s;
 
 	if (!groupmatch || ast_strlen_zero(groupmatch))

Index: file.c
===================================================================
RCS file: /usr/cvsroot/asterisk/file.c,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -d -r1.74 -r1.75
--- file.c	30 Aug 2005 02:12:09 -0000	1.74
+++ file.c	7 Sep 2005 21:01:31 -0000	1.75
@@ -464,7 +464,7 @@
 	int fd = -1;
 	int fmts = -1;
 	char filename2[256]="";
-	char filename3[256]="";
+	char filename3[256];
 	char *endpart;
 	int res;
 
@@ -1149,7 +1149,7 @@
 	/* XXX Maybe I should just front-end ast_waitstream_full ? XXX */
 	int res;
 	struct ast_frame *fr;
-	char exten[AST_MAX_EXTENSION] = "";
+	char exten[AST_MAX_EXTENSION];
 
 	if (!context) context = c->context;
 	while(c->stream) {

Index: pbx.c
===================================================================
RCS file: /usr/cvsroot/asterisk/pbx.c,v
retrieving revision 1.271
retrieving revision 1.272
diff -u -d -r1.271 -r1.272
--- pbx.c	2 Sep 2005 18:07:26 -0000	1.271
+++ pbx.c	7 Sep 2005 21:01:31 -0000	1.272
@@ -902,7 +902,7 @@
 void pbx_retrieve_variable(struct ast_channel *c, const char *var, char **ret, char *workspace, int workspacelen, struct varshead *headp)
 {
 	char *first,*second;
-	char tmpvar[80] = "";
+	char tmpvar[80];
 	time_t thistime;
 	struct tm brokentime;
 	int offset,offset2;
@@ -5362,7 +5362,7 @@
 
 static int pbx_builtin_prefix(struct ast_channel *chan, void *data)
 {
-	char newexten[AST_MAX_EXTENSION] = "";
+	char newexten[AST_MAX_EXTENSION];
 
 	if (!data || ast_strlen_zero(data)) {
 		ast_log(LOG_DEBUG, "Ignoring, since there is no prefix to add\n");
@@ -5377,7 +5377,7 @@
 
 static int pbx_builtin_suffix(struct ast_channel *chan, void *data)
 {
-	char newexten[AST_MAX_EXTENSION] = "";
+	char newexten[AST_MAX_EXTENSION];
 
 	if (!data || ast_strlen_zero(data)) {
 		ast_log(LOG_DEBUG, "Ignoring, since there is no suffix to add\n");




More information about the svn-commits mailing list