Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gcc 11 warning #2

Open
polluks opened this issue May 12, 2023 · 0 comments
Open

gcc 11 warning #2

polluks opened this issue May 12, 2023 · 0 comments

Comments

@polluks
Copy link
Contributor

polluks commented May 12, 2023

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);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@polluks polluks changed the title gcc warning gcc 11 warning May 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant