mirror of
https://github.com/versity/scoutfs.git
synced 2026-02-07 11:10:44 +00:00
scoutfs: check snprintf_key() format args
Add the function attribute to snprintf_key() to have the compiler verify its print format and args. I noticed some buggy changes that didn't throw errors. Happily none of the existing calls had problems. Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
@@ -128,9 +128,10 @@ void scoutfs_key_dec(struct scoutfs_key_buf *key)
|
||||
* formatting to represent the trailing bytes: runs of zeros compresesd
|
||||
* to _ and then hex output of non-zero bytes.
|
||||
*/
|
||||
static int snprintf_key(char *buf, size_t size, struct scoutfs_key_buf *key,
|
||||
unsigned min_len, unsigned fmt_len,
|
||||
const char *fmt, ...)
|
||||
static int __printf(6, 7) snprintf_key(char *buf, size_t size,
|
||||
struct scoutfs_key_buf *key,
|
||||
unsigned min_len, unsigned fmt_len,
|
||||
const char *fmt, ...)
|
||||
|
||||
{
|
||||
va_list args;
|
||||
|
||||
Reference in New Issue
Block a user