<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(92, 38, 153); ">String<span style="color: #000000">::</span>String<span style="color: #000000">(</span><span style="color: #aa0d91">const</span><span style="color: #000000"> </span>ByteVector<span style="color: #000000"> &v, </span><span style="color: #2e0d6e">Type</span><span style="color: #000000"> t)</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">{</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "> d = <span style="color: #aa0d91">new</span> StringPrivate;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "> <span style="color: #aa0d91">if</span>(v.<span style="color: #5c2699">isEmpty</span>())</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(170, 13, 145); "><span style="color: #000000"> </span>return<span style="color: #000000">;</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "> <span style="color: #aa0d91">if</span>(t == <span style="color: #2e0d6e">Latin1</span> || t == <span style="color: #2e0d6e">UTF8</span>) {</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "> <span style="color: #aa0d91">int</span> length = <span style="color: #1c00cf">0</span>;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "> d-><span style="color: #5c2699">data</span>.<span style="color: #2e0d6e">resize</span>(v.<span style="color: #5c2699">size</span>());</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "> <span style="color: #5c2699">wstring</span>::<span style="color: #5c2699">iterator</span> targetIt = d-><span style="color: #5c2699">data</span>.<span style="color: #2e0d6e">begin</span>();</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "> <span style="color: #aa0d91">for</span>(<span style="color: #5c2699">ByteVector</span>::<span style="color: #5c2699">ConstIterator</span> it = v.<span style="color: #2e0d6e">begin</span>(); it != v.<span style="color: #2e0d6e">end</span>() && (*it); ++it) {</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "> *targetIt = <span style="color: #5c2699">uchar</span>(*it);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "> ++targetIt;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "> ++length;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "> }</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "> d-><span style="color: #5c2699">data</span>.<span style="color: #2e0d6e">resize</span>(length);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "> }</div><div><br></div><div><br></div>If I see that correct is the check && (*it) a bit too much. Because the input is a ByteVector it should be clear that the binary can contain NULL values. But it should not matter as long we get the size (and this one we always have). I guess it was copy&pasted from the other constructors?<div><br></div><div><br></div><div><br></div><div>Regards, Matthieu Riolo.</div></body></html>