Fix enqueueing bug

This commit is contained in:
Scott Lahteine 2019-06-23 22:21:33 -05:00
parent 12d21e642f
commit cf762d2c73

View File

@ -204,7 +204,7 @@ void GCodeQueue::enqueue_now_P(PGM_P const pgcode) {
PGM_P p = pgcode;
for (;;) {
char c;
while ((c = p[i]) && c != '\n') i++;
while ((c = pgm_read_byte(&p[i])) && c != '\n') i++;
char cmd[i + 1];
memcpy_P(cmd, p, i);
cmd[i] = '\0';