<div dir="ltr"><div><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__msdn.microsoft.com_en-2Dus_library_1kt27hek.aspx&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=GsdcyIgPKjrZNe-caBkTkTRI7JareNzz8g8gaUjK5jQ&s=VaXae2xFca9C7g9J4goSkVWwVOiYeAbg17DqTRzGjDs&e=">https://msdn.microsoft.com/en-us/library/1kt27hek.aspx</a><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span style="color:rgb(42,42,42);font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif;font-size:13px;line-height:18px">If </span><span class="" style="font-style:italic;color:rgb(42,42,42);font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif;font-size:13px;line-height:18px">buffer</span><span style="color:rgb(42,42,42);font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif;font-size:13px;line-height:18px"> or </span><span class="" style="font-style:italic;color:rgb(42,42,42);font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif;font-size:13px;line-height:18px">format</span><span style="color:rgb(42,42,42);font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif;font-size:13px;line-height:18px"> is </span><span style="color:rgb(42,42,42);font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif;font-size:13px;line-height:18px"><span class="" style="font-weight:700">NULL</span></span><span style="color:rgb(42,42,42);font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif;font-size:13px;line-height:18px">, or if count is less than or equal to zero, these functions invoke the invalid parameter handler, as described in </span><span style="color:rgb(42,42,42);font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif;font-size:13px;line-height:18px"><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__msdn.microsoft.com_en-2Dus_library_ksazx244.aspx&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=GsdcyIgPKjrZNe-caBkTkTRI7JareNzz8g8gaUjK5jQ&s=rLvhPjVdmnx4EFe5Xp5-45aKBnk-RTqEGGnUkoeS2lU&e=" style="text-decoration:none;color:rgb(3,105,122)">Parameter Validation</a></span><span style="color:rgb(42,42,42);font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif;font-size:13px;line-height:18px">. If execution is allowed to continue, these functions return -1 <u>and set </u></span><u><span style="color:rgb(42,42,42);font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif;font-size:13px;line-height:18px"><span class="" style="font-weight:700">errno</span></span><span style="color:rgb(42,42,42);font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif;font-size:13px;line-height:18px"> to </span><span style="color:rgb(42,42,42);font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif;font-size:13px;line-height:18px"><span class="" style="font-weight:700">EINVAL</span></span></u><span style="color:rgb(42,42,42);font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif;font-size:13px;line-height:18px">.</span></blockquote></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 27, 2015 at 9:02 AM, Zachary Turner <span dir="ltr"><<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I hadn't thought to write to /dev/null to get the length. Good idea. But why do you check for !errno? The docs just say that if _vsnprintf fails it returns -1, it doesn't say anything about errno.<br>
<br>
<br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D10048&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=GsdcyIgPKjrZNe-caBkTkTRI7JareNzz8g8gaUjK5jQ&s=ZvmG2FAcHna__DtYYn8z8ZMlNSr_jEVajI5nIGoxZyE&e=" target="_blank">http://reviews.llvm.org/D10048</a><br>
<br>
EMAIL PREFERENCES<br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_settings_panel_emailpreferences_&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=GsdcyIgPKjrZNe-caBkTkTRI7JareNzz8g8gaUjK5jQ&s=hPW41mmcoi4YQo3tP2P4OTP3s83CQafrn1uRfKP1MBw&e=" target="_blank">http://reviews.llvm.org/settings/panel/emailpreferences/</a><br>
<br>
<br>
</blockquote></div><br></div>