Re: deprecating sprintf(9)

From: Ryan Stone <rysto32_at_gmail.com>
Date: Wed, 8 Sep 2010 12:47:41 -0400
> #define bprintf(buf, fmt, ...)                                          \
>        do {                                                            \
>                assert(snprintf(buf, sizeof buf, fmt, __VA_ARGS__)      \
>                    < sizeof buf);                                      \
>        } while (0)

Anyone using this macro is in for a nasty surprise when they compile
with -DNDEBUG.
Received on Wed Sep 08 2010 - 15:17:13 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:07 UTC