diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-08-10 19:20:57 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-08-10 19:20:57 +0000 |
commit | d1ec1aa57d296243d584ad268d8e61d7d1998569 (patch) | |
tree | 2596a6cb913ad8bd78e4670d298dc1d4682b2d23 /utils/extconf.c | |
parent | 4548c33d84f71a04a0416a26b9f0dea0ae061cc4 (diff) |
AST-2009-005
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@211539 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'utils/extconf.c')
-rw-r--r-- | utils/extconf.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/utils/extconf.c b/utils/extconf.c index 08465c408..25d7b137f 100644 --- a/utils/extconf.c +++ b/utils/extconf.c @@ -3149,7 +3149,7 @@ static int lookup_name(const char *s, char *const names[], int max) } /* Allow months and weekdays to be specified as numbers, as well */ - if (sscanf(s, "%d", &i) == 1 && i >= 1 && i <= max) { + if (sscanf(s, "%2d", &i) == 1 && i >= 1 && i <= max) { /* What the array offset would have been: "1" would be at offset 0 */ return i - 1; } @@ -3226,7 +3226,7 @@ static void get_timerange(struct ast_timing *i, char *times) /* Otherwise expect a range */ while ((part = strsep(×, "&"))) { if (!(endpart = strchr(part, '-'))) { - if (sscanf(part, "%d:%d", &st_h, &st_m) != 2 || st_h < 0 || st_h > 23 || st_m < 0 || st_m > 59) { + if (sscanf(part, "%2d:%2d", &st_h, &st_m) != 2 || st_h < 0 || st_h > 23 || st_m < 0 || st_m > 59) { ast_log(LOG_WARNING, "%s isn't a valid time.\n", part); continue; } @@ -3242,11 +3242,11 @@ static void get_timerange(struct ast_timing *i, char *times) ast_log(LOG_WARNING, "Invalid time range starting with '%s-'.\n", part); continue; } - if (sscanf(part, "%d:%d", &st_h, &st_m) != 2 || st_h < 0 || st_h > 23 || st_m < 0 || st_m > 59) { + if (sscanf(part, "%2d:%2d", &st_h, &st_m) != 2 || st_h < 0 || st_h > 23 || st_m < 0 || st_m > 59) { ast_log(LOG_WARNING, "'%s' isn't a valid start time.\n", part); continue; } - if (sscanf(endpart, "%d:%d", &endh, &endm) != 2 || endh < 0 || endh > 23 || endm < 0 || endm > 59) { + if (sscanf(endpart, "%2d:%2d", &endh, &endm) != 2 || endh < 0 || endh > 23 || endm < 0 || endm > 59) { ast_log(LOG_WARNING, "'%s' isn't a valid end time.\n", endpart); continue; } @@ -5541,7 +5541,7 @@ static int parse_variable_name(char *var, int *offset, int *length, int *isfunc) parens--; } else if (*var == ':' && parens == 0) { *var++ = '\0'; - sscanf(var, "%d:%d", offset, length); + sscanf(var, "%30d:%30d", offset, length); return 1; /* offset:length valid */ } } @@ -5945,7 +5945,7 @@ static int pbx_load_config(const char *config_file) ipri = lastpri; else ast_log(LOG_WARNING, "Can't use 'same' priority on the first entry!\n"); - } else if (sscanf(pri, "%d", &ipri) != 1 && + } else if (sscanf(pri, "%30d", &ipri) != 1 && (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; |