diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-08-10 19:25:03 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-08-10 19:25:03 +0000 |
commit | dbef80dfa2752f6306e45af841d5573ccfd14f03 (patch) | |
tree | 638d77074098ba848a915b044a9c6b4d12efb4ca /funcs/func_cut.c | |
parent | 55ecd87dff70a3ca8ff715adae8d95b68c238e26 (diff) |
AST-2009-005
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@211551 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs/func_cut.c')
-rw-r--r-- | funcs/func_cut.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/funcs/func_cut.c b/funcs/func_cut.c index eace3ecd4..787dfe95f 100644 --- a/funcs/func_cut.c +++ b/funcs/func_cut.c @@ -89,7 +89,7 @@ static int sort_internal(struct ast_channel *chan, char *data, char *buffer, siz } *ptrvalue++ = '\0'; sortable_keys[count2].key = ptrkey; - sscanf(ptrvalue, "%f", &sortable_keys[count2].value); + sscanf(ptrvalue, "%30f", &sortable_keys[count2].value); count2++; } @@ -153,15 +153,15 @@ static int cut_internal(struct ast_channel *chan, char *data, char *buffer, size int num1 = 0, num2 = MAXRESULT; char trashchar; - if (sscanf(nextgroup, "%d-%d", &num1, &num2) == 2) { + if (sscanf(nextgroup, "%30d-%30d", &num1, &num2) == 2) { /* range with both start and end */ - } else if (sscanf(nextgroup, "-%d", &num2) == 1) { + } else if (sscanf(nextgroup, "-%30d", &num2) == 1) { /* range with end */ num1 = 0; - } else if ((sscanf(nextgroup, "%d%c", &num1, &trashchar) == 2) && (trashchar == '-')) { + } else if ((sscanf(nextgroup, "%30d%1c", &num1, &trashchar) == 2) && (trashchar == '-')) { /* range with start */ num2 = MAXRESULT; - } else if (sscanf(nextgroup, "%d", &num1) == 1) { + } else if (sscanf(nextgroup, "%30d", &num1) == 1) { /* single number */ num2 = num1; } else { |