aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_substring.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-07-14 07:34:34 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-07-14 07:34:34 +0000
commit4e18ef688947854313b99f35aa30c0e7d8ae29cd (patch)
tree54b0d7240765bc43ef378f171a536e6bc7d206d9 /apps/app_substring.c
parent59d780973e0c1aab681be9dcba1baa2706caf92f (diff)
Merge rgagnon's pedantic string changes (apps n-z) (bug #2038)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3429 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_substring.c')
-rwxr-xr-xapps/app_substring.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/app_substring.c b/apps/app_substring.c
index d2b2f8c0d..fb6d81f6c 100755
--- a/apps/app_substring.c
+++ b/apps/app_substring.c
@@ -59,9 +59,10 @@ static int substring_exec(struct ast_channel *chan, void *data)
char newexten[AST_MAX_EXTENSION] = "";
char *count1, *count2;
char *first, *second, *stringp;
+
stringp=alloca(strlen(data)+1);
ast_log(LOG_WARNING, "The use of Substring application is deprecated. Please use ${variable:a:b} instead\n");
- strncpy(stringp,data,strlen(data)+1);
+ strncpy(stringp,data,strlen(data));
if (strchr(stringp,'|')&&strchr(stringp,'=')) {
int icount1,icount2;
first=strsep(&stringp,"=");