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

Kornev/add c flags and fix FW issues #148

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

evgenykor
Copy link
Contributor

No description provided.

Evgeny Kornev added 2 commits October 22, 2024 20:23
Let the compiler to protect you from shooting
yourself in the foot
Fix different issues spotted by compiler
// If the buffer is full, ignore the latest messages.
if (webusb_ptr_in + len >= WEBUSB_BUFFER_SIZE-64-1) {
return;
}
// Add message to the buffer.
strncpy(webusb_buffer + webusb_ptr_in, msg, len);
memcpy((char*)(webusb_buffer + webusb_ptr_in), msg, len);
webusb_buffer[webusb_ptr_in + len] = '\0';
Copy link
Contributor

Choose a reason for hiding this comment

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

I will have to try if this creates problems, the WebUSB buffer is not string based, but takes fixed size chunks.

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