[asterisk-commits] file: trunk r43264 - /trunk/main/frame.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Sep 19 08:36:26 MST 2006


Author: file
Date: Tue Sep 19 10:36:25 2006
New Revision: 43264

URL: http://svn.digium.com/view/asterisk?rev=43264&view=rev
Log:
Warning be gone!

Modified:
    trunk/main/frame.c

Modified: trunk/main/frame.c
URL: http://svn.digium.com/view/asterisk/trunk/main/frame.c?rev=43264&r1=43263&r2=43264&view=diff
==============================================================================
--- trunk/main/frame.c (original)
+++ trunk/main/frame.c Tue Sep 19 10:36:25 2006
@@ -1251,24 +1251,19 @@
 
 void ast_parse_allow_disallow(struct ast_codec_pref *pref, int *mask, const char *list, int allowing) 
 {
-	char *parse;
-	char *this;
-	int format;
-	char *psize;
-	int framems;
+	char *parse = NULL, *this = NULL, *psize = NULL;
+	int format = 0, framems = 0;
 
 	parse = ast_strdupa(list);
 	while ((this = strsep(&parse, ","))) {
 		framems = 0;
 		if ((psize = strrchr(this, ':'))) {
-			*psize = '\0';
-			psize++;
+			*psize++ = '\0';
 			if (option_debug)
 				ast_log(LOG_DEBUG,"Packetization for codec: %s is %s\n", this, psize);
-			framems = strtol(psize,NULL,10);
-			if (framems == LONG_MIN || framems == LONG_MAX) {
+			framems = atoi(psize);
+			if (framems < 0)
 				framems = 0;
-			}
 		}
 		if (!(format = ast_getformatbyname(this))) {
 			ast_log(LOG_WARNING, "Cannot %s unknown format '%s'\n", allowing ? "allow" : "disallow", this);



More information about the asterisk-commits mailing list