Skip to content

gcc 11 warning #2

@polluks

Description

@polluks
cc -c -Wall -O2 ex.c
ex.c: In function 'ex_exec':
ex.c:240:34: warning: '%s' directive output may be truncated writing up to 511 bytes into a region of size between 0 and 511 [-Wformat-truncation=]
   snprintf(hln, sizeof(hln), "%s %s\n", hdr, val);
                                  ^~          ~~~
ex.c:240:3: note: 'snprintf' output between 3 and 1025 bytes into a destination of size 512
   snprintf(hln, sizeof(hln), "%s %s\n", hdr, val);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions