️ Use strlcpy with buffer size (#26513)

This commit is contained in:
Scott Lahteine 2023-12-08 00:47:18 -06:00 committed by GitHub
parent 6c04cf40f4
commit dfec58e5dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 51 additions and 61 deletions

View file

@ -134,7 +134,7 @@ public:
* Aborts the current SRAM queue so only use for one or two commands.
*/
static void inject(const char * const gcode) {
strncpy(injected_commands, gcode, sizeof(injected_commands) - 1);
strlcpy(injected_commands, gcode, sizeof(injected_commands));
}
/**