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

Modified Files:
        pbx_config.c pbx_dundi.c pbx_loopback.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: pbx_config.c
===================================================================
RCS file: /usr/cvsroot/asterisk/pbx/pbx_config.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -d -r1.58 -r1.59
--- pbx_config.c        27 Apr 2005 04:52:58 -0000      1.58
+++ pbx_config.c        29 Apr 2005 17:00:33 -0000      1.59
@@ -1191,7 +1191,7 @@
        if (!strcmp(prior, "hint")) {
                        iprior = PRIORITY_HINT;
                } else {
-                       if (sscanf(prior, "%i", &iprior) != 1) {
+                       if (sscanf(prior, "%d", &iprior) != 1) {
                                ast_cli(fd, "'%s' is not a valid priority\n", 
prior);
                                prior = NULL;
                        }
@@ -1700,7 +1700,7 @@
                                                                else
                                                                        
ast_log(LOG_WARNING, "Can't use 'same' priority on the first entry!\n");
                                                        } else  {
-                                                               if (sscanf(pri, 
"%i", &ipri) != 1) {
+                                                               if (sscanf(pri, 
"%d", &ipri) != 1) {
                                                                        if 
((ipri = ast_findlabel_extension2(NULL, con, realext, pri, cidmatch)) < 1) {
                                                                                
ast_log(LOG_WARNING, "Invalid priority/label '%s' at line %d\n", pri, 
v->lineno);
                                                                                
ipri = 0;

Index: pbx_dundi.c
===================================================================
RCS file: /usr/cvsroot/asterisk/pbx/pbx_dundi.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- pbx_dundi.c 21 Apr 2005 06:02:44 -0000      1.32
+++ pbx_dundi.c 29 Apr 2005 17:00:33 -0000      1.33
@@ -4059,7 +4059,7 @@
                        } else if (x >= 4) {
                                strncpy(map->dcontext, name, 
sizeof(map->dcontext) - 1);
                                strncpy(map->lcontext, fields[0], 
sizeof(map->lcontext) - 1);
-                               if ((sscanf(fields[1], "%i", &map->weight) == 
1) && (map->weight >= 0) && (map->weight < 60000)) {
+                               if ((sscanf(fields[1], "%d", &map->weight) == 
1) && (map->weight >= 0) && (map->weight < 60000)) {
                                        strncpy(map->dest, fields[3], 
sizeof(map->dest) - 1);
                                        if ((map->tech = str2tech(fields[2]))) {
                                                map->dead = 0;
@@ -4502,14 +4502,14 @@
                } else if (!strcasecmp(v->name, "authdebug")) {
                        authdebug = ast_true(v->value);
                } else if (!strcasecmp(v->name, "ttl")) {
-                       if ((sscanf(v->value, "%i", &x) == 1) && (x > 0) && (x 
< DUNDI_DEFAULT_TTL)) {
+                       if ((sscanf(v->value, "%d", &x) == 1) && (x > 0) && (x 
< DUNDI_DEFAULT_TTL)) {
                                dundi_ttl = x;
                        } else {
                                ast_log(LOG_WARNING, "'%s' is not a valid TTL 
at line %d, must be number from 1 to %d\n",
                                        v->value, v->lineno, DUNDI_DEFAULT_TTL);
                        }
                } else if (!strcasecmp(v->name, "autokill")) {
-                       if (sscanf(v->value, "%i", &x) == 1) {
+                       if (sscanf(v->value, "%d", &x) == 1) {
                                if (x >= 0)
                                        global_autokilltimeout = x;
                                else
@@ -4525,7 +4525,7 @@
                        else
                                ast_log(LOG_WARNING, "Invalid global endpoint 
identifier '%s' at line %d\n", v->value, v->lineno);
                } else if (!strcasecmp(v->name, "tos")) {
-                       if (sscanf(v->value, "%i", &format) == 1)
+                       if (sscanf(v->value, "%d", &format) == 1)
                                tos = format & 0xff;
                        else if (!strcasecmp(v->value, "lowdelay"))
                                tos = IPTOS_LOWDELAY;

Index: pbx_loopback.c
===================================================================
RCS file: /usr/cvsroot/asterisk/pbx/pbx_loopback.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- pbx_loopback.c      21 Apr 2005 06:02:44 -0000      1.5
+++ pbx_loopback.c      29 Apr 2005 17:00:33 -0000      1.6
@@ -108,7 +108,7 @@
        if (con && !ast_strlen_zero(con))
                *newcontext = con;
        if (pri && !ast_strlen_zero(pri))
-               sscanf(pri, "%i", priority);
+               sscanf(pri, "%d", priority);
 }
 
 static int loopback_exists(struct ast_channel *chan, const char *context, 
const char *exten, int priority, const char *callerid, const char *data)

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

Reply via email to