<div dir="ltr"><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="font-size:12.8000001907349px">So as far as I can tell the value of `errno` is undefined in the case that `buffer`, `format`, and `count` are all valid, but `count` is just not big enough (which is really the case we're trying to handle anyway).</span></blockquote><div><br></div><div>FWIW, I think it's not defined in the MSDN docs because it's already defined in the C standard for all system/library calls.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 27, 2015 at 9:25 AM, Chaoren Lin <span dir="ltr"><<a href="mailto:chaorenl@google.com" target="_blank">chaorenl@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="im HOEnZb">> So as far as I can tell the value of `errno` is undefined in the case that<br>
<br>
>  `buffer`, `format`, and `count` are all valid, but `count` is just not big<br>
<br>
>  enough (which is really the case we're trying to handle anyway).<br>
<br>
<br>
Yeah, errno should be 0 only in the case that count is not big enough,<br>
which is exactly what I'm checking for. (It's the caller's responsibility<br>
to clear errno before calling snprintf). Otherwise, there's an error, and<br>
it should be returned as is, and the fprintf wouldn't be necessary.<br>
<br>
<br>
</span><div class="HOEnZb"><div class="h5"><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D10048&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=cWsKoGadc_QeAzre7UtlHVOML0Yi0Ew1hz9BOoZxjtY&s=dynNJozCutYol8KZgVaMSUvGk4TvJwgxhnWAgYxBv5g&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=cWsKoGadc_QeAzre7UtlHVOML0Yi0Ew1hz9BOoZxjtY&s=g658_HFXlZZKSFLSvSIx1RaCMjTUSaIu7z9lb3BMHik&e=" target="_blank">http://reviews.llvm.org/settings/panel/emailpreferences/</a><br>
<br>
<br>
</div></div></blockquote></div><br></div>