libmount: add __format__ attribute

Reported-by: Jan Pazdziora <jpazdziora@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2021-06-18 16:34:20 +02:00
parent b22ecdd840
commit 292161888c
2 changed files with 3 additions and 2 deletions

View File

@ -2702,7 +2702,7 @@ int mnt_context_strerror(struct libmnt_context *cxt __attribute__((__unused__)),
}
int mnt_context_get_generic_excode(int rc, char *buf, size_t bufsz, char *fmt, ...)
int mnt_context_get_generic_excode(int rc, char *buf, size_t bufsz, const char *fmt, ...)
{
va_list va;

View File

@ -454,7 +454,8 @@ extern int mnt_context_set_tabfilter(struct libmnt_context *cxt,
int (*fltr)(struct libmnt_fs *, void *),
void *data);
extern int mnt_context_get_generic_excode(int rc, char *buf, size_t bufsz, char *fmt, ...);
extern int mnt_context_get_generic_excode(int rc, char *buf, size_t bufsz, const char *fmt, ...)
__attribute__ ((__format__ (__printf__, 4, 5)));
extern int mnt_context_get_mount_excode(struct libmnt_context *cxt, int mntrc, char *buf, size_t bufsz);
extern int mnt_context_get_umount_excode(struct libmnt_context *cxt, int mntrc, char *buf, size_t bufsz);