1
0
Fork 0

Com: Make the comment length explicit

sendComment cannot send more than 62 bytes, as limited by the HID report.
Sending more is prevented by vsnprintf, but change the function signature
to make it explicit that the array passed to it should be at most 62 bytes.
This commit is contained in:
trotFunky 2023-10-22 21:16:49 +01:00
parent 005f4e1bea
commit b0753ada9f
3 changed files with 3 additions and 3 deletions

2
.gitignore vendored
View file

@ -1,2 +1,2 @@
.pio
.idea
**/.idea

View file

@ -14,7 +14,7 @@
*/
namespace Com {
void sendFigUpdate(int8_t event);
void sendComment(const char* message, ...);
void sendComment(const char message[62], ...);
}
#endif //JIN_BARBAPAPA_COM_H

View file

@ -28,7 +28,7 @@ namespace Com {
flushBuffer();
}
void sendComment(const char *message, ...) {
void sendComment(const char message[62], ...) {
va_list args;
va_start(args, message);
buffer[0] = '#';