Skip to content

bwm-ng fails to compile with gcc format-security enabled #1398

@joaochainho

Description

@joaochainho

Since trunk r46003, bwm-ng fails to compile with gcc format-security enabled.

output.c: In function 'print_header':
output.c:237:13: error: format not a string literal and no format arguments [-Werror=format-security]
             printf(input2str());
             ^
cc1: some warnings being treated as errors
make[5]: *** [output.o] Error 1

I would like to suggest a patch that solves this issue.

--- a/src/output.c
+++ b/src/output.c
@@ -234,7 +234,7 @@ int print_header(int option) {
            if (output_method==PLAIN_OUT && ansi_output) printf("\033[1;2H");
            printf("bwm-ng v" VERSION " (delay %2.3fs); ",(float)delay/1000);
            if (output_method==PLAIN_OUT) printf("press 'ctrl-c' to end this%s",(ansi_output ? "\033[2;2H" : "")); else printf("input: ");
-            printf(input2str());
+            printf("%s\n",input2str());
             printf("%s\n",show_all_if2str());
            if (output_method==PLAIN_OUT) {
                if (ansi_output)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions