[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: best way to deal with macOS deprecation of sprintf?
From: |
Bruno Haible |
Subject: |
Re: best way to deal with macOS deprecation of sprintf? |
Date: |
Thu, 03 Nov 2022 22:12:37 +0100 |
Jeffrey Walton wrote:
> snprintf is kind of a lame for a replacement since it backfills the
> buffer with all 0's.
Nope, it doesn't. [1]
You must be confusing it with strncpy(), which fills all the buffer. [2]
Bruno
[1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/fprintf.html
[2] https://pubs.opengroup.org/onlinepubs/9699919799/functions/strncpy.html