<p>Joshua Colp <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/19722">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span></span><br></pre><div style="white-space:pre-wrap">Approvals:
George Joseph: Looks good to me, approved
Joshua Colp: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_if: Fix format truncation errors.<br><br>Fixes format truncation warnings in gcc 12.2.1.<br><br>ASTERISK-30349 #close<br><br>Change-Id: I42be4edf0284358b906e765d1966b6b9d66e1d3c<br>---<br>M apps/app_if.c<br>1 file changed, 17 insertions(+), 3 deletions(-)<br><br></pre>
<pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/apps/app_if.c b/apps/app_if.c</span><br><span>index b1ff0ad..bc04ffd 100644</span><br><span>--- a/apps/app_if.c</span><br><span>+++ b/apps/app_if.c</span><br><span>@@ -234,7 +234,8 @@</span><br><span> const char *if_pri = NULL;</span><br><span> char *my_name = NULL;</span><br><span> const char *label = NULL;</span><br><span style="color: hsl(0, 100%, 40%);">- char varname[VAR_SIZE], end_varname[VAR_SIZE + 4];</span><br><span style="color: hsl(120, 100%, 40%);">+ char varname[VAR_SIZE + 3]; /* + IF_ */</span><br><span style="color: hsl(120, 100%, 40%);">+ char end_varname[sizeof(varname) + 4]; /* + END_ + sizeof(varname) */</span><br><span> const char *prefix = "IF";</span><br><span> size_t size = 0;</span><br><span> int used_index_i = -1, x = 0;</span><br><span>@@ -252,8 +253,8 @@</span><br><span> }</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- snprintf(used_index, VAR_SIZE, "%d", used_index_i);</span><br><span style="color: hsl(0, 100%, 40%);">- snprintf(new_index, VAR_SIZE, "%d", used_index_i + 1);</span><br><span style="color: hsl(120, 100%, 40%);">+ snprintf(used_index, sizeof(used_index), "%d", used_index_i);</span><br><span style="color: hsl(120, 100%, 40%);">+ snprintf(new_index, sizeof(new_index), "%d", used_index_i + 1);</span><br><span> </span><br><span> size = strlen(ast_channel_context(chan)) + strlen(ast_channel_exten(chan)) + 32;</span><br><span> my_name = ast_alloca(size);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/19722">change 19722</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/19722"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 20 </div>
<div style="display:none"> Gerrit-Change-Id: I42be4edf0284358b906e765d1966b6b9d66e1d3c </div>
<div style="display:none"> Gerrit-Change-Number: 19722 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: N A <asterisk@phreaknet.org> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>