[Lldb-commits] [PATCH] Implement snprintf for MSVC with correct return value.
chaorenl at google.com
Wed May 27 09:33:09 PDT 2015
> 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).
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.
On Wed, May 27, 2015 at 9:25 AM, Chaoren Lin <chaorenl at google.com> wrote:
> > So as far as I can tell the value of `errno` is undefined in the case
> > `buffer`, `format`, and `count` are all valid, but `count` is just not
> > enough (which is really the case we're trying to handle anyway).
> Yeah, errno should be 0 only in the case that count is not big enough,
> which is exactly what I'm checking for. (It's the caller's responsibility
> to clear errno before calling snprintf). Otherwise, there's an error, and
> it should be returned as is, and the fprintf wouldn't be necessary.
> EMAIL PREFERENCES
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the lldb-commits