[asterisk-commits] branch murf/AEL2 - r8369 /team/murf/AEL2/pbx/pbx_ael2.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Jan 20 21:50:19 MST 2006


Author: murf
Date: Fri Jan 20 22:50:18 2006
New Revision: 8369

URL: http://svn.digium.com/view/asterisk?rev=8369&view=rev
Log:
inserted and tested a check to issue a warning if a label declaration is a numeric value.


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

Modified: team/murf/AEL2/pbx/pbx_ael2.c
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2/pbx/pbx_ael2.c?rev=8369&r1=8368&r2=8369&view=diff
==============================================================================
--- team/murf/AEL2/pbx/pbx_ael2.c (original)
+++ team/murf/AEL2/pbx/pbx_ael2.c Fri Jan 20 22:50:18 2006
@@ -2152,6 +2152,11 @@
 	case PV_LABEL:
 		/* fields: item->u1.str     == label name
 		*/
+		if ( strspn(item->u1.str, "0123456789") == strlen(item->u1.str) ) {
+			ast_log(LOG_WARNING,"Warning: file %s, line %d-%d: label '%s' is numeric, this is bad practice!\n",
+					item->filename, item->startline, item->endline, item->u1.str);
+			warns++;
+		}
 		break;
 			
 	case PV_FOR:



More information about the asterisk-commits mailing list