How so?  Suppose you've got a function which takes a const char*.  Obviously it's null terminated or your function wouldn't be able to work.  If you replace that with a StringRef it's still null terminated because the call site hasn't changed.  Either way, its up to the caller to pass something null terminated.<br><br>Any time you construct a StringRef from a std::string or ConstString, which is very close to 100% of what we do, the StringRef is guaranteed to be null terminated.<br><br>That said, in Pavels first response i missed the part where he said "or even better change the receiving function to work with a StringRef ".  I agree that's better.<br><div class="gmail_quote">On Mon, Feb 23, 2015 at 9:22 AM Joerg Sonnenberger <<a href="mailto:joerg@britannica.bec.de">joerg@britannica.bec.de</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Mon, Feb 23, 2015 at 04:01:53PM +0000, Zachary Turner wrote:<br>
> No we don't. A const char* is not guaranteed to be null terminated either.<br>
> Its up to you to make sure you pass it a null terminated string. Same<br>
> applies here.<br>
<br>
I don't understand your point. StringRef is pretty much guaranteed to<br>
not be null terminated, at least not at the right place.<br>
<br>
Joerg<br>
______________________________<u></u>_________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@cs.uiuc.edu" target="_blank">lldb-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/lldb-commits</a><br>
</blockquote></div>