[Asterisk-cvs] asterisk acl.c, 1.41, 1.42 app.c, 1.57, 1.58 channel.c, 1.192, 1.193 cli.c, 1.78, 1.79 manager.c, 1.93, 1.94 pbx.c, 1.232, 1.233

kpfleming at lists.digium.com kpfleming at lists.digium.com
Fri Apr 29 12:11:01 CDT 2005


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

Modified Files:
	acl.c app.c channel.c cli.c manager.c pbx.c 
Log Message:
don't use '%i' at all, since we have no current use cases that need non base-10 parsing (bug #4110)


Index: acl.c
===================================================================
RCS file: /usr/cvsroot/asterisk/acl.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- acl.c	22 Apr 2005 13:11:34 -0000	1.41
+++ acl.c	29 Apr 2005 17:00:33 -0000	1.42
@@ -150,7 +150,7 @@
 			nm++;
 		}
 		if (!strchr(nm, '.')) {
-			if ((sscanf(nm, "%i", &x) == 1) && (x >= 0) && (x <= 32)) {
+			if ((sscanf(nm, "%d", &x) == 1) && (x >= 0) && (x <= 32)) {
 				y = 0;
 				for (z=0;z<x;z++) {
 					y >>= 1;

Index: app.c
===================================================================
RCS file: /usr/cvsroot/asterisk/app.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- app.c	22 Apr 2005 13:11:34 -0000	1.57
+++ app.c	29 Apr 2005 17:00:33 -0000	1.58
@@ -571,7 +571,7 @@
 	end=start;  /* pre-initialize end to be same as start in case we never get into loop */
 	for (x=0;x<fmtcnt;x++) {
 		others[x] = ast_writefile(recordfile, sfmt[x], comment, O_TRUNC, 0, 0700);
-		ast_verbose( VERBOSE_PREFIX_3 "x=%i, open writing:  %s format: %s, %p\n", x, recordfile, sfmt[x], others[x]);
+		ast_verbose( VERBOSE_PREFIX_3 "x=%d, open writing:  %s format: %s, %p\n", x, recordfile, sfmt[x], others[x]);
 
 		if (!others[x]) {
 			break;
@@ -793,7 +793,7 @@
 	end=start;  /* pre-initialize end to be same as start in case we never get into loop */
 	for (x=0;x<fmtcnt;x++) {
 		others[x] = ast_writefile(prependfile, sfmt[x], comment, O_TRUNC, 0, 0700);
-		ast_verbose( VERBOSE_PREFIX_3 "x=%i, open writing:  %s format: %s, %p\n", x, prependfile, sfmt[x], others[x]);
+		ast_verbose( VERBOSE_PREFIX_3 "x=%d, open writing:  %s format: %s, %p\n", x, prependfile, sfmt[x], others[x]);
 		if (!others[x]) {
 			break;
 		}

Index: channel.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channel.c,v
retrieving revision 1.192
retrieving revision 1.193
diff -u -d -r1.192 -r1.193
--- channel.c	24 Apr 2005 22:54:50 -0000	1.192
+++ channel.c	29 Apr 2005 17:00:33 -0000	1.193
@@ -854,7 +854,7 @@
 	manager_event(EVENT_FLAG_CALL, "Hangup", 
 			"Channel: %s\r\n"
 			"Uniqueid: %s\r\n"
-			"Cause: %i\r\n",
+			"Cause: %d\r\n",
 			chan->name, chan->uniqueid, chan->hangupcause);
 	ast_channel_free(chan);
 	return res;

Index: cli.c
===================================================================
RCS file: /usr/cvsroot/asterisk/cli.c,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -d -r1.78 -r1.79
--- cli.c	22 Apr 2005 13:11:34 -0000	1.78
+++ cli.c	29 Apr 2005 17:00:33 -0000	1.79
@@ -583,7 +583,7 @@
 	char *filename = "<any>";
 	if ((argc < 3) || (argc > 4))
 		return RESULT_SHOWUSAGE;
-	if (sscanf(argv[2], "%i", &newlevel) != 1)
+	if (sscanf(argv[2], "%d", &newlevel) != 1)
 		return RESULT_SHOWUSAGE;
 	option_debug = newlevel;
 	if (argc == 4) {

Index: manager.c
===================================================================
RCS file: /usr/cvsroot/asterisk/manager.c,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -d -r1.93 -r1.94
--- manager.c	21 Apr 2005 06:02:43 -0000	1.93
+++ manager.c	29 Apr 2005 17:00:33 -0000	1.94
@@ -896,7 +896,7 @@
 			"Channel: %s/%s\r\n"
 			"Context: %s\r\n"
 			"Exten: %s\r\n"
-			"Reason: %i\r\n"
+			"Reason: %d\r\n"
 			"Uniqueid: %s\r\n",
 			in->idtext, in->tech, in->data, in->context, in->exten, reason, chan ? chan->uniqueid : "<null>");
 	else
@@ -906,7 +906,7 @@
 			"Channel: %s/%s\r\n"
 			"Context: %s\r\n"
 			"Exten: %s\r\n"
-			"Reason: %i\r\n"
+			"Reason: %d\r\n"
 			"Uniqueid: %s\r\n",
 			in->idtext, in->tech, in->data, in->context, in->exten, reason, chan ? chan->uniqueid : "<null>");
 

Index: pbx.c
===================================================================
RCS file: /usr/cvsroot/asterisk/pbx.c,v
retrieving revision 1.232
retrieving revision 1.233
diff -u -d -r1.232 -r1.233
--- pbx.c	29 Apr 2005 15:04:25 -0000	1.232
+++ pbx.c	29 Apr 2005 17:00:33 -0000	1.233
@@ -1057,7 +1057,7 @@
 		snprintf(workspace, workspacelen, "%s", c->uniqueid);
 		*ret = workspace;
 	} else if (c && !strcmp(var, "HANGUPCAUSE")) {
-		snprintf(workspace, workspacelen, "%i", c->hangupcause);
+		snprintf(workspace, workspacelen, "%d", c->hangupcause);
 		*ret = workspace;
 	} else if (c && !strcmp(var, "ACCOUNTCODE")) {
 		strncpy(workspace, c->accountcode, workspacelen - 1);
@@ -5261,7 +5261,7 @@
 	struct ast_frame *f;
 	int waittime;
 	
-	if (!data || !strlen(data) || (sscanf(data, "%i", &waittime) != 1) || (waittime < 0))
+	if (!data || !strlen(data) || (sscanf(data, "%d", &waittime) != 1) || (waittime < 0))
 		waittime = -1;
 	if (waittime > -1) {
 		ast_safe_sleep(chan, waittime * 1000);




More information about the svn-commits mailing list