From: Andrey Volk Date: Thu, 7 May 2020 22:56:37 +0000 (+0400) Subject: [mod_amr] scan-build: fix dead increment of fmtptmp_pos in switch_amr_init() X-Git-Tag: v1.10.3^2~1^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F619%2Fhead;p=thirdparty%2Ffreeswitch.git [mod_amr] scan-build: fix dead increment of fmtptmp_pos in switch_amr_init() --- diff --git a/src/mod/codecs/mod_amr/mod_amr.c b/src/mod/codecs/mod_amr/mod_amr.c index 1155a29a1c..b9d2c5882d 100644 --- a/src/mod/codecs/mod_amr/mod_amr.c +++ b/src/mod/codecs/mod_amr/mod_amr.c @@ -359,10 +359,10 @@ static switch_status_t switch_amr_init(switch_codec_t *codec, switch_codec_flag_ if (!globals.volte) { - fmtptmp_pos += switch_snprintf(fmtptmp + fmtptmp_pos, sizeof(fmtptmp) - fmtptmp_pos, ";octet-align=%d", switch_test_flag(context, AMR_OPT_OCTET_ALIGN) ? 1 : 0); + switch_snprintf(fmtptmp + fmtptmp_pos, sizeof(fmtptmp) - fmtptmp_pos, ";octet-align=%d", switch_test_flag(context, AMR_OPT_OCTET_ALIGN) ? 1 : 0); } else { /* some UEs reject the call with 488 if mode-change-capability is not 2 */ - fmtptmp_pos += switch_snprintf(fmtptmp + fmtptmp_pos, sizeof(fmtptmp) - fmtptmp_pos, ";octet-align=%d;max-red=0;mode-change-capability=2", + switch_snprintf(fmtptmp + fmtptmp_pos, sizeof(fmtptmp) - fmtptmp_pos, ";octet-align=%d;max-red=0;mode-change-capability=2", switch_test_flag(context, AMR_OPT_OCTET_ALIGN) ? 1 : 0); } codec->fmtp_out = switch_core_strdup(codec->memory_pool, fmtptmp);