]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix jitter buffer log file creation
authorKinsey Moore <kmoore@digium.com>
Wed, 18 Sep 2013 19:54:36 +0000 (19:54 +0000)
committerKinsey Moore <kmoore@digium.com>
Wed, 18 Sep 2013 19:54:36 +0000 (19:54 +0000)
This adjusts '/'-to-'#' replacement to replace all instances of '/'
instead of just the first to ensure that the jitter buffer log file
gets the correct name as per Richard Kenner's suggestion.

(closes issue ASTERISK-21036)
Reported by: Richard Kenner

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@399402 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/abstract_jb.c

index 135903110181d2b624212f6791249a9ab021bc6c..32bd11aed3bb847de19e20dec26e6c1040a6f5c4 100644 (file)
@@ -488,7 +488,7 @@ static int create_jb(struct ast_channel *chan, struct ast_frame *frr)
                char safe_logfile[30] = "/tmp/logfile-XXXXXX";
                int safe_fd;
                snprintf(name2, sizeof(name2), "%s", chan->name);
-               if ((tmp = strchr(name2, '/'))) {
+               while ((tmp = strchr(name2, '/'))) {
                        *tmp = '#';
                }
 
@@ -497,7 +497,7 @@ static int create_jb(struct ast_channel *chan, struct ast_frame *frr)
                ast_assert(bridged != NULL);
 
                snprintf(name1, sizeof(name1), "%s", bridged->name);
-               if ((tmp = strchr(name1, '/'))) {
+               while ((tmp = strchr(name1, '/'))) {
                        *tmp = '#';
                }