<p>Richard Mudgett <strong>posted comments</strong> on this change.</p><p><a href="https://gerrit.asterisk.org/7871">View Change</a></p><p>Patch set 5:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4;">Code-Review -1</span></p><p>(4 comments)</p><ul style="list-style: none; padding-left: 20px;"><li><p><a href="https://gerrit.asterisk.org/#/c/7871/5/include/asterisk/vector.h">File include/asterisk/vector.h:</a></p><ul style="list-style: none; padding-left: 20px;"><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/7871/5/include/asterisk/vector.h@69">Patch Set #5, Line 69:</a> <code style="font-family:monospace,monospace">int ast_vector_string_split(struct ast_vector_string *dest,</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Return value meaning?</p></li></ul></li><li><p><a href="https://gerrit.asterisk.org/#/c/7871/5/main/strings.c">File main/strings.c:</a></p><ul style="list-style: none; padding-left: 20px;"><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/7871/5/main/strings.c@407">Patch Set #5, Line 407:</a> <code style="font-family:monospace,monospace">     ast_assert(dest != NULL);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">The dest and delim asserts should be done the first thing in the function.  They are checking/declaring constraints of the parameters.</p></li><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/7871/5/main/strings.c@408">Patch Set #5, Line 408:</a> <code style="font-family:monospace,monospace">       ast_assert(buf != NULL);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">buf can never be NULL from ast_strdupa() because buf was allocated from the stack.  Blowing the stack is unrecoverable.</p></li><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/7871/5/main/strings.c@411">Patch Set #5, Line 411:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">  while ((cur = strsep(&buf, delim))) {<br>             if (excludes_cmp && AST_VECTOR_GET_CMP(dest, cur, !excludes_cmp)) {<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">A potential option is to ast_strip() blanks and skip empty strings.  This way you could use the function to parse comma separated lists that include spaces:<br>alice, bob, charlie</p><p style="white-space: pre-wrap; word-wrap: break-word;">It does depend on the purpose of this function and the increased interface complexity if it is worth adding.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/7871">change 7871</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/7871"/><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: comment </div>
<div style="display:none"> Gerrit-Change-Id: I1bf02a1efeb2baeea11c59c557d39dd1197494d7 </div>
<div style="display:none"> Gerrit-Change-Number: 7871 </div>
<div style="display:none"> Gerrit-PatchSet: 5 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.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>
<div style="display:none"> Gerrit-Comment-Date: Sun, 14 Jan 2018 20:58:42 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>