Remove strcpy compile warning

This commit is contained in:
Scott Lahteine 2020-05-12 01:45:28 -05:00
parent d4aa197744
commit d853a70556

View File

@ -216,13 +216,12 @@ bool GCodeQueue::process_injected_command() {
gcode.process_parsed_command();
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wrestrict"
// Copy the next command into place
strcpy(injected_commands, &injected_commands[i + (c != '\0')]);
#pragma GCC diagnostic pop
for (
uint8_t d = 0, s = i + !!c; // dst, src
(injected_commands[d] = injected_commands[s]); // copy, exit if 0
d++, s++ // next dst, src
);
return true;
}