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

Fix gcc truncate and overflow warnings #2649

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

Miguel-hrvs
Copy link
Contributor

No description provided.


char buf[sizeof "00:00"];
char buf[32];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you replaced sizeof "00:00" with 32, we don't need 32 bytes here

@@ -248,8 +248,8 @@ static void saveOptions(Config* config)
{
const struct StudioOptions* options = &config->data.options;

string buf;
sprintf(buf.data, JSON(
char buf[2048];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you removed using of string struct and increased it from 1024 to 2048

@@ -237,7 +237,7 @@ static void drawTileIndex(Map* map, s32 x, s32 y)

if(index >= 0)
{
char buf[sizeof "#9999"];
char buf[16];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, we don't need 16 bytes here

@Miguel-hrvs
Copy link
Contributor Author

I'll try to improve it

@Miguel-hrvs Miguel-hrvs marked this pull request as draft August 19, 2024 07:56
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