[svn-commits] murf: branch murf/AEL2-1.2 r48453 - /team/murf/AEL2-1.2/pbx/pbx_ael2.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Wed Dec 13 10:27:07 MST 2006


Author: murf
Date: Wed Dec 13 11:27:06 2006
New Revision: 48453

URL: http://svn.digium.com/view/asterisk?view=rev&rev=48453
Log:
backport changes from the trunk version

Modified:
    team/murf/AEL2-1.2/pbx/pbx_ael2.c

Modified: team/murf/AEL2-1.2/pbx/pbx_ael2.c
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2-1.2/pbx/pbx_ael2.c?view=diff&rev=48453&r1=48452&r2=48453
==============================================================================
--- team/murf/AEL2-1.2/pbx/pbx_ael2.c (original)
+++ team/murf/AEL2-1.2/pbx/pbx_ael2.c Wed Dec 13 11:27:06 2006
@@ -812,7 +812,7 @@
 		char *incl_context = p4->u1.str;
 		/* find a matching context name */
 		struct pval *that_other_context = find_context(incl_context);
-		if (!that_other_context) {
+		if (!that_other_context && strcmp(incl_context, "parkedcalls") != 0) {
 			ast_log(LOG_WARNING, "Warning: file %s, line %d-%d: The included context '%s' cannot be found.\n",
 					includes->filename, includes->startline, includes->endline, incl_context);
 			warns++;
@@ -823,13 +823,13 @@
 
 static void check_timerange(pval *p)
 {
-	char times[200];
+	char *times;
 	char *e;
 	int s1, s2;
 	int e1, e2;
 
-
-	strncpy(times, p->u1.str, sizeof(times));
+	times = ast_strdupa(p->u1.str);
+
 	/* Star is all times */
 	if (ast_strlen_zero(times) || !strcmp(times, "*")) {
 		return;
@@ -891,13 +891,13 @@
 /*! \brief  get_dow: Get day of week */
 static void check_dow(pval *DOW)
 {
-	char dow[200];
+	char *dow;
 	char *c;
 	/* The following line is coincidence, really! */
 	int s, e;
 	
-	strncpy(dow,DOW->u1.str,sizeof(dow));
- 
+	dow = ast_strdupa(DOW->u1.str);
+
 	/* Check for all days */
 	if (ast_strlen_zero(dow) || !strcmp(dow, "*"))
 		return;
@@ -930,12 +930,13 @@
 
 static void check_day(pval *DAY)
 {
-	char day[200];
+	char *day;
 	char *c;
 	/* The following line is coincidence, really! */
 	int s, e;
 
-	strncpy(day,DAY->u1.str,sizeof(day));
+	day = ast_strdupa(DAY->u1.str);
+
 	/* Check for all days */
 	if (ast_strlen_zero(day) || !strcmp(day, "*")) {
 		return;
@@ -992,12 +993,13 @@
 
 static void check_month(pval *MON)
 {
-	char mon[200];
+	char *mon;
 	char *c;
 	/* The following line is coincidence, really! */
 	int s, e;
 
-	strncpy(mon,MON->u1.str,sizeof(mon));
+	mon = ast_strdupa(MON->u1.str);
+
 	/* Check for all days */
 	if (ast_strlen_zero(mon) || !strcmp(mon, "*")) 
 		return ;
@@ -1876,14 +1878,14 @@
 int option_matches_j( struct argdesc *should, pval *is, struct argapp *app)
 {
 	struct argchoice *ac;
-	char opcop[400],*q,*p;
+	char *opcop,*q,*p;
 	
 	switch (should->dtype) {
 	case ARGD_OPTIONSET:
 		if ( strstr(is->u1.str,"${") )
 			return 0;  /* no checking anything if there's a var reference in there! */
 			
-		strncpy(opcop,is->u1.str,sizeof(opcop));
+		opcop = ast_strdupa(is->u1.str);
 
 		for (q=opcop;*q;q++) { /* erase the innards of X(innard) type arguments, so we don't get confused later */
 			if ( *q == '(' ) {
@@ -1938,7 +1940,7 @@
 int option_matches( struct argdesc *should, pval *is, struct argapp *app)
 {
 	struct argchoice *ac;
-	char opcop[400];
+	char *opcop;
 	
 	switch (should->dtype) {
 	case ARGD_STRING:
@@ -1973,7 +1975,7 @@
 		break;
 		
 	case ARGD_OPTIONSET:
-		strncpy(opcop,is->u1.str,sizeof(opcop));
+		opcop = ast_strdupa(is->u1.str);
 		
 		for (ac=app->opts; ac; ac=ac->next) {
 			if (strlen(ac->name)>1  && strchr(ac->name,'(') == 0 && strcmp(ac->name,is->u1.str) == 0) /* multichar option, no parens, and a match? */
@@ -2065,7 +2067,7 @@
 {
 #ifdef AAL_ARGCHECK
 	/* get and clean the variable name */
-	char buff1[1024],*p;
+	char *buff1, *p;
 	struct argapp *a,*a2;
 	struct appsetvar *v,*v2;
 	struct argchoice *c;
@@ -2075,7 +2077,8 @@
 	while (p && *p && (*p == ' ' || *p == '\t' || *p == '$' || *p == '{' ) )
 		p++;
 	
-	strncpy(buff1,p,sizeof(buff1));
+	buff1 = ast_strdupa(p);
+
 	while (strlen(buff1) > 0 && ( buff1[strlen(buff1)-1] == '}' || buff1[strlen(buff1)-1] == ' ' || buff1[strlen(buff1)-1] == '\t'))
 		buff1[strlen(buff1)-1] = 0;
 	/* buff1 now contains the variable name */
@@ -3839,7 +3842,10 @@
 	
 }
 
+
 /* interface stuff */
+
+/* if all the below are static, who cares if they are present? */
 
 static int pbx_load_module(void)
 {



More information about the svn-commits mailing list