8000 Fix warnings with GCC 7.1 and later (which are errors due to -Werror). by paul-donahue · Pull Request #10 · jayantom/sknobs · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix warnings with GCC 7.1 and later (which are errors due to -Werror). #10

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

Merged
merged 1 commit into from
Jan 20, 2021

Conversation

paul-donahue
Copy link
Contributor

Fixes this:

sknobs.c: In function 'sknobs_find_file':
sknobs.c:817:62: error: 'snprintf' output may be truncated before the last format character [-Werror=format-truncation=]
  817 |     snprintf(filename_buffer, sizeof(filename_buffer), "%s/%s", search_path, filename_buffer2);
      |                                                              ^
sknobs.c:817:5: note: 'snprintf' output 2 or more bytes (assuming 4097) into a destination of size 4096
  817 |     snprintf(filename_buffer, sizeof(filename_buffer), "%s/%s", search_path, filename_buffer2);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sknobs.c: In function 'sknobs_init':
sknobs.c:1119:43: error: '%s' directive output may be truncated writing up to 8191 bytes into a region of size 4096 [-Werror=format-truncation=]
 1119 |     snprintf(filename, sizeof(filename), "%s/.stopknobs", buffer);
      |                                           ^~              ~~~~~~
sknobs.c:1119:5: note: 'snprintf' output between 12 and 8203 bytes into a destination of size 4096
 1119 |     snprintf(filename, sizeof(filename), "%s/.stopknobs", buffer);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~```

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

Successfully merging this pull request may close these issues.

2 participants
0