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

Warnings on Fedora 30 #5

Open
dioni21 opened this issue Oct 16, 2019 · 1 comment
Open

Warnings on Fedora 30 #5

dioni21 opened this issue Oct 16, 2019 · 1 comment

Comments

@dioni21
Copy link

dioni21 commented Oct 16, 2019

src/parsing.c: In function ‘parse_object_close’:
src/parsing.c:80:5: warning: ‘strncat’ specified bound depends on the length of the source argument [-Wstringop-overflow=]
   80 |     strncat(value, to_append, strlen(to_append));
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CC gcc -c src/tokens.c -o lib/tokens.o  -O3 -g -std=gnu99  -fstack-protector-all -Wstack-protector -Wall -Wextra -pedantic 
src/tokens.c: In function ‘set_color’:
src/tokens.c:57:5: warning: ‘strncpy’ specified bound 6 equals destination size [-Wstringop-truncation]
   57 |     strncpy(token->color, color, COLOR_STR_SIZE);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function ‘set_color’,
    inlined from ‘update_token’ at src/tokens.c:87:5:
src/tokens.c:57:5: warning: ‘strncpy’ specified bound 6 equals destination size [-Wstringop-truncation]
   57 |     strncpy(token->color, color, COLOR_STR_SIZE);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@dioni21
Copy link
Author

dioni21 commented Oct 16, 2019

Indeed, if you limit by array size, where will the \0 for string end be? 😂

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