diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-04-12 16:08:20 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-04-12 16:08:20 +0000 |
commit | f1248d73487597d50a24172f6dc2e31f0f3e793b (patch) | |
tree | 7e3370cdfa269619a26396321a1a86f4a414bab0 /apps/app_cut.c | |
parent | 4f3c4779f7cf441c4d1491666230d428907bd0cb (diff) |
Fix cut properly (bug #1138)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2676 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_cut.c')
-rwxr-xr-x | apps/app_cut.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/apps/app_cut.c b/apps/app_cut.c index 18de2d10a..aa180f1a5 100755 --- a/apps/app_cut.c +++ b/apps/app_cut.c @@ -5,7 +5,7 @@ * * Copyright (c) 2003 Tilghman Lesher. All rights reserved. * - * Tilghman Lesher <app_cut__v002@the-tilghman.com> + * Tilghman Lesher <app_cut__v003@the-tilghman.com> * * $Id$ * @@ -82,16 +82,14 @@ static int cut_exec(struct ast_channel *chan, void *data) if (args_okay) { char d, ds[2]; char *tmp = alloca(strlen(varname) + 4); - char *tmp2 = alloca(MAXRESULT); + char varvalue[MAXRESULT], *tmp2=varvalue; char retstring[MAXRESULT]; - if (tmp2) - memset(tmp2, 0, MAXRESULT); memset(retstring, 0, MAXRESULT); - if (tmp && tmp2) { + if (tmp) { snprintf(tmp, strlen(varname) + 4, "${%s}", varname); - memset(tmp2, 0, sizeof(tmp2)); + memset(varvalue, 0, sizeof(varvalue)); } else { ast_log(LOG_ERROR, "Out of memory"); return -1; |