diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-09-19 15:36:25 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-09-19 15:36:25 +0000 |
commit | defea1a6a4ff492604b9a6722a02170b049ac753 (patch) | |
tree | fa2e93079adaff45518961696007d88203471aa5 /main | |
parent | 6433ea97811944ad5d2d435a2c7810de7a802fcc (diff) |
Warning be gone!
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@43264 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r-- | main/frame.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/main/frame.c b/main/frame.c index be18148a3..ad747abda 100644 --- a/main/frame.c +++ b/main/frame.c @@ -1251,24 +1251,19 @@ int ast_codec_choose(struct ast_codec_pref *pref, int formats, int find_best) 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); |