diff --git a/WHATS_NEW b/WHATS_NEW index b1088040a..2c53735dd 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.25 - ================================= + Add -Wformat-security and change one fprintf() to fputs(). Move regex functions into libdevmapper. Change some #include lines to search only standard system directories. Add devices/preferred_names config regex list for displayed device names. diff --git a/lib/format_text/export.c b/lib/format_text/export.c index d8127e6d9..576893544 100644 --- a/lib/format_text/export.c +++ b/lib/format_text/export.c @@ -160,7 +160,7 @@ static int _out_with_comment_file(struct formatter *f, const char *comment, for (i = 0; i < f->indent; i++) white_space[i] = '\t'; white_space[i] = '\0'; - fprintf(f->data.fp, white_space); + fputs(white_space, f->data.fp); i = vfprintf(f->data.fp, fmt, ap); if (comment) { @@ -176,7 +176,7 @@ static int _out_with_comment_file(struct formatter *f, const char *comment, while (++i < COMMENT_TAB); - fprintf(f->data.fp, comment); + fputs(comment, f->data.fp); } fputc('\n', f->data.fp); diff --git a/make.tmpl.in b/make.tmpl.in index 162f77f5e..a607f514b 100644 --- a/make.tmpl.in +++ b/make.tmpl.in @@ -56,7 +56,7 @@ endif .SUFFIXES: .c .d .o .so .a .po .pot .mo .dylib -CFLAGS += -fPIC -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wmissing-noreturn +CFLAGS += -fPIC -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wmissing-noreturn -Wformat-security #CFLAGS += -W -Wconversion -Wpointer-arith -Wredundant-decls -Wbad-function-cast -Wcast-qual #CFLAGS += -pedantic -std=gnu99