<p>Jenkins2 <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/7942">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Kevin Harwell: Looks good to me, but someone else must approve
Richard Mudgett: Looks good to me, approved
Jenkins2: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_config_pgsql: Avoid typecasting an int to unsigned char.<br><br>clang 5.0 warned about this.<br><br>ASTERISK-27576<br><br>Change-Id: If41f400a51973c06cdb9b75462e535b616bfe385<br>---<br>M res/res_config_pgsql.c<br>1 file changed, 5 insertions(+), 4 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/res/res_config_pgsql.c b/res/res_config_pgsql.c<br>index e436e2f..cee4e48 100644<br>--- a/res/res_config_pgsql.c<br>+++ b/res/res_config_pgsql.c<br>@@ -1215,7 +1215,8 @@<br> struct columns *column;<br> struct tables *table;<br> char *elm;<br>- int type, size, res = 0;<br>+ int type, res = 0;<br>+ unsigned int size;<br> <br> /*<br> * Ignore database from the extconfig.conf since it was<br>@@ -1231,7 +1232,7 @@<br> <br> while ((elm = va_arg(ap, char *))) {<br> type = va_arg(ap, require_type);<br>- size = va_arg(ap, int);<br>+ size = va_arg(ap, unsigned int);<br> AST_LIST_TRAVERSE(&table->columns, column, list) {<br> if (strcmp(column->name, elm) == 0) {<br> /* Char can hold anything, as long as it is large enough */<br>@@ -1288,14 +1289,14 @@<br> res = -1;<br> } else {<br> struct ast_str *sql = ast_str_create(100);<br>- char fieldtype[15];<br>+ char fieldtype[10];<br> PGresult *result;<br> <br> if (requirements == RQ_CREATECHAR || type == RQ_CHAR) {<br> /* Size is minimum length; make it at least 50% greater,<br> * just to be sure, because PostgreSQL doesn't support<br> * resizing columns. */<br>- snprintf(fieldtype, sizeof(fieldtype), "CHAR(%hhu)",<br>+ snprintf(fieldtype, sizeof(fieldtype), "CHAR(%u)",<br> size < 15 ? size * 2 :<br> (size * 3 / 2 > 255) ? 255 : size * 3 / 2);<br> } else if (type == RQ_INTEGER1 || type == RQ_UINTEGER1 || type == RQ_INTEGER2) {<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/7942">change 7942</a>. To unsubscribe, 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/7942"/><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-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: If41f400a51973c06cdb9b75462e535b616bfe385 </div>
<div style="display:none"> Gerrit-Change-Number: 7942 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Alexander Traud <pabstraud@compuserve.com> </div>
<div style="display:none"> Gerrit-Reviewer: Alexander Traud <pabstraud@compuserve.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>