[Lldb-commits] [PATCH] Implement snprintf for MSVC with correct return value.

Chaoren Lin chaorenl at google.com
Wed May 27 09:07:43 PDT 2015


> If buffer or format is NULL, or if count is less than or equal to zero,
> these functions invoke the invalid parameter handler, as described in Parameter
> Validation <https://msdn.microsoft.com/en-us/library/ksazx244.aspx>. If
> execution is allowed to continue, these functions return -1 *and set *
> *errno to EINVAL*.

On Wed, May 27, 2015 at 9:02 AM, Zachary Turner <zturner at google.com> wrote:

> 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.
> http://reviews.llvm.org/D10048
>   http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150527/a902ad14/attachment.html>

More information about the lldb-commits mailing list