[asterisk-commits] tilghman: branch tilghman/str_substitution r189202 - /team/tilghman/str_subst...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Apr 17 18:21:37 CDT 2009


Author: tilghman
Date: Fri Apr 17 18:21:34 2009
New Revision: 189202

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=189202
Log:
Another static buffer that needs to be dynamic

Modified:
    team/tilghman/str_substitution/apps/app_voicemail.c

Modified: team/tilghman/str_substitution/apps/app_voicemail.c
URL: http://svn.digium.com/svn-view/asterisk/team/tilghman/str_substitution/apps/app_voicemail.c?view=diff&rev=189202&r1=189201&r2=189202
==============================================================================
--- team/tilghman/str_substitution/apps/app_voicemail.c (original)
+++ team/tilghman/str_substitution/apps/app_voicemail.c Fri Apr 17 18:21:34 2009
@@ -5075,7 +5075,7 @@
 	char fmt[80];
 	char *context;
 	char ecodes[17] = "#";
-	char tmp[1024] = "";
+	struct ast_str *tmp = ast_str_create(16);
 	char *tmpptr;
 	struct ast_vm_user *vmu;
 	struct ast_vm_user svm;
@@ -5084,9 +5084,13 @@
 	const char *alldtmf = "0123456789ABCD*#";
 	char flag[80];
 
-	ast_copy_string(tmp, ext, sizeof(tmp));
-	ext = tmp;
-	if ((context = strchr(tmp, '@'))) {
+	if (!tmp) {
+		return -1;
+	}
+
+	ast_str_set(&tmp, 0, "%s", ext);
+	ext = ast_str_buffer(tmp);
+	if ((context = strchr(ext, '@'))) {
 		*context++ = '\0';
 		tmpptr = strchr(context, '&');
 	} else {




More information about the asterisk-commits mailing list