fence-virt: Format string cleanup

Warn on non-literal format strings and cleanup.

Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
This commit is contained in:
Ryan McCabe 2017-05-29 13:54:51 -04:00
parent bcfc5703d3
commit b0aa3ad784
7 changed files with 7 additions and 8 deletions

View File

@ -2,7 +2,7 @@ CC=@CC@
CXX=@CXX@
CFLAGS=@CFLAGS@
CFLAGS+=-fPIC -Wall -Wstrict-prototypes -Wshadow -D_GNU_SOURCE
CFLAGS+=-fPIC -Wall -Wformat=2 -Wstrict-prototypes -Wshadow -D_GNU_SOURCE
LEX=@LEX@
YACC=@YACC@

View File

@ -31,11 +31,9 @@
/* Local includes */
#include "xvm.h"
#include "ip_lookup.h"
#include "simple_auth.h"
#include "options.h"
#include "tcp.h"
#include "mcast.h"
#include "debug.h"
#include "fdops.h"

View File

@ -124,6 +124,7 @@ insert_entry(int sev, char *buf, int bufsz)
}
__attribute__((__format__ (__printf__, 2, 0)))
void
__wrap_syslog(int severity, const char *fmt, ...)
{

View File

@ -42,7 +42,7 @@ config.c: y.tab.h config.l
$(LEX) -oconfig.c config.l
%.o: %.c
gcc $(CFLAGS) -c -o $@ $^ $(INCLUDES)
$(CC) $(CFLAGS) -c -o $@ $^ $(INCLUDES)
clean:
rm -f ${TARGETS} *~ *.o testprog config.tab.c config.tab.h config.c

View File

@ -358,7 +358,7 @@ cpg_start( const char *name,
if (!name)
return -1;
ret = snprintf(gname.value, sizeof(gname.value), name);
ret = snprintf(gname.value, sizeof(gname.value), "%s", name);
if (ret <= 0)
return -1;

View File

@ -1,5 +1,5 @@
#ifndef _VIRT_SERIAL_H_
#define _VIRT_SERIAL_H
#ifndef __VIRT_SERIAL_H
#define __VIRT_SERIAL_H
#include <sys/select.h>

View File

@ -1,4 +1,4 @@
#ifndef __UIID_TEST_H
#ifndef __UUID_TEST_H
#define __UUID_TEST_H
#ifdef __cplusplus