mirror of
https://github.com/topjohnwu/selinux.git
synced 2025-02-18 18:30:41 +00:00
libselinux: Add printf format attribute annotation to die() method
Annotating the die method as taking printf format exposes a bug in error reporting Signed-off-by: Eric Paris <eparis@redhat.com> Acked-by: Dan Walsh <dwalsh@redhat.com>
This commit is contained in:
parent
57928fa1fd
commit
91d9fe8af0
@ -43,7 +43,7 @@ static char buf[DEF_BUF_SIZE];
|
||||
/* selinuxfs mount point */
|
||||
extern char *selinux_mnt;
|
||||
|
||||
static void die(const char *msg, ...)
|
||||
static __attribute__((__format__(printf,1,2))) void die(const char *msg, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
@ -118,7 +118,7 @@ int main(int argc, char **argv)
|
||||
exit(0);
|
||||
default:
|
||||
usage();
|
||||
die("unrecognized parameter", i);
|
||||
die("unrecognized parameter '%c'", i);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user