[Asterisk-cvs] asterisk pbx.c,1.55,1.56
markster at lists.digium.com
markster at lists.digium.com
Fri Sep 26 21:21:07 CDT 2003
Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv19202
Modified Files:
pbx.c
Log Message:
Move to asprintf (bug #252)
Index: pbx.c
===================================================================
RCS file: /usr/cvsroot/asterisk/pbx.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- pbx.c 22 Sep 2003 15:27:09 -0000 1.55
+++ pbx.c 27 Sep 2003 02:22:18 -0000 1.56
@@ -2336,8 +2336,8 @@
static int handle_show_application(int fd, int argc, char *argv[])
{
struct ast_app *a;
- char buf[2048];
- int app, no_registered_app = 1;
+ int n, app, no_registered_app = 1;
+ char *buf;
if (argc < 3) return RESULT_SHOWUSAGE;
@@ -2357,14 +2357,17 @@
no_registered_app = 0;
/* ... one of our applications, show info ...*/
- snprintf(buf, sizeof(buf),
+ n = asprintf(&buf,
"\n -= Info about application '%s' =- \n\n"
"[Synopsis]:\n %s\n\n"
"[Description]:\n%s\n",
a->name,
a->synopsis ? a->synopsis : "Not available",
a->description ? a-> description : "Not available");
- ast_cli(fd, buf);
+ if (n >= 0) {
+ ast_cli(fd, buf);
+ free(buf);
+ }
}
}
a = a->next;
More information about the svn-commits
mailing list