From 8634ef9e4a57d128a295f1f114d2c97c32fa400c Mon Sep 17 00:00:00 2001 From: "Kevin P. Fleming" Date: Fri, 29 Apr 2005 17:00:33 +0000 Subject: don't use '%i' at all, since we have no current use cases that need non base-10 parsing (bug #4110) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5533 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- pbx/pbx_config.c | 4 ++-- pbx/pbx_dundi.c | 8 ++++---- pbx/pbx_loopback.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'pbx') diff --git a/pbx/pbx_config.c b/pbx/pbx_config.c index 33a669396..a2056e784 100755 --- a/pbx/pbx_config.c +++ b/pbx/pbx_config.c @@ -1191,7 +1191,7 @@ static int handle_context_add_extension(int fd, int argc, char *argv[]) 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 @@ static int pbx_load_module(void) 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; diff --git a/pbx/pbx_dundi.c b/pbx/pbx_dundi.c index b80867b29..ca3c4441a 100755 --- a/pbx/pbx_dundi.c +++ b/pbx/pbx_dundi.c @@ -4059,7 +4059,7 @@ static void build_mapping(char *name, char *value) } 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 @@ static int set_config(char *config_file, struct sockaddr_in* sin) } 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 @@ static int set_config(char *config_file, struct sockaddr_in* sin) 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; diff --git a/pbx/pbx_loopback.c b/pbx/pbx_loopback.c index 8fb7b3f7e..065cac855 100755 --- a/pbx/pbx_loopback.c +++ b/pbx/pbx_loopback.c @@ -108,7 +108,7 @@ static void loopback_subst(char **newexten, char **newcontext, int *priority, ch 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) -- cgit v1.2.3