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

Resize theme_name string #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

bm3719
Copy link

@bm3719 bm3719 commented Apr 15, 2024

Was getting this error running make:

cc -O2 -pipe  -c -std=c89 -Wall -Wextra -Werror -O2 `pkg-config --cflags pangocairo` settings.c
settings.c:659:49: error: 'sscanf' may overflow; destination buffer in argument 3 has size 100, but the corresponding specifier may require size 101 [-Werror,-Wfortify-source]
                if (1 == sscanf(line, " [%100[-a-zA-Z0-9]] ", theme_name)) {
                                                              ^
1 error generated.
*** Error 1 in /home/bm3719/src/c/oxbar (Makefile:38 'settings.o')

I think this is because sscanf can return up to 101 bytes (100 characters + \0).

sscanf can return up to 101 bytes (100 characters + \0).
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.

None yet

1 participant