<p>Friendly Automation <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/18986">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:
Joshua Colp: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved
Friendly Automation: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">chan_dahdi.c: Resolve a format-truncation build warning.<br><br>With gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0:<br><br>> chan_dahdi.c:4129:18: error: ā%sā directive output may be truncated<br>> writing up to 255 bytes into a region of size between 242 and 252<br>> [-Werror=format-truncation=]<br><br>This removes the error-prone sizeof(...) calculations in favor of just<br>doubling the size of the base buffer.<br><br>Change-Id: I2d276785286730d3d5d0a921bcea2e065dbf27c5<br>---<br>M channels/chan_dahdi.c<br>1 file changed, 21 insertions(+), 2 deletions(-)<br><br></pre>
<pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c</span><br><span>index 8ce0526..b829aa4 100644</span><br><span>--- a/channels/chan_dahdi.c</span><br><span>+++ b/channels/chan_dahdi.c</span><br><span>@@ -4115,7 +4115,7 @@</span><br><span> {</span><br><span> #define CONTEXT_TAG "Context - "</span><br><span> char logmsg[256];</span><br><span style="color: hsl(0, 100%, 40%);">- char completemsg[sizeof(logmsg) + sizeof(CONTEXT_TAG) - 1];</span><br><span style="color: hsl(120, 100%, 40%);">+ char completemsg[sizeof(logmsg) * 2];</span><br><span> vsnprintf(logmsg, sizeof(logmsg), fmt, ap);</span><br><span> snprintf(completemsg, sizeof(completemsg), CONTEXT_TAG "%s", logmsg);</span><br><span> dahdi_r2_write_log(level, completemsg);</span><br><span>@@ -4128,10 +4128,11 @@</span><br><span> {</span><br><span> #define CHAN_TAG "Chan "</span><br><span> char logmsg[256];</span><br><span style="color: hsl(0, 100%, 40%);">- char completemsg[sizeof(logmsg) + sizeof(CHAN_TAG) - 1];</span><br><span style="color: hsl(120, 100%, 40%);">+ char completemsg[sizeof(logmsg) * 2];</span><br><span> vsnprintf(logmsg, sizeof(logmsg), fmt, ap);</span><br><span> snprintf(completemsg, sizeof(completemsg), CHAN_TAG "%d - %s", openr2_chan_get_number(r2chan), logmsg);</span><br><span> dahdi_r2_write_log(level, completemsg);</span><br><span style="color: hsl(120, 100%, 40%);">+#undef CHAN_TAG</span><br><span> }</span><br><span> </span><br><span> static int dahdi_r2_on_dnis_digit_received(openr2_chan_t *r2chan, char digit)</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/18986">change 18986</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/+/18986"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I2d276785286730d3d5d0a921bcea2e065dbf27c5 </div>
<div style="display:none"> Gerrit-Change-Number: 18986 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: Sean Bright <sean@seanbright.com> </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>