Fix Malyan LCD crash bug (#17855)

This commit is contained in:
mojocorp 2020-05-04 21:03:01 +02:00 committed by GitHub
parent 714df3001a
commit 1c32f10039
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -378,12 +378,12 @@ void parse_lcd_byte(const byte b) {
|| (!is_lcd && c == '\n') // LF on a G-code command || (!is_lcd && c == '\n') // LF on a G-code command
) { ) {
inbound_buffer[inbound_count] = '\0'; // Reset before processing inbound_buffer[inbound_count] = '\0'; // Reset before processing
parsing = 0; // Unflag and...
inbound_count = 0; // Reset buffer index inbound_count = 0; // Reset buffer index
if (parsing == 1) if (parsing == 1)
process_lcd_command(inbound_buffer); // Handle the LCD command process_lcd_command(inbound_buffer); // Handle the LCD command
else else
queue.enqueue_one_now(inbound_buffer); // Handle the G-code command queue.enqueue_one_now(inbound_buffer); // Handle the G-code command
parsing = 0; // Unflag and...
} }
else if (inbound_count < MAX_CURLY_COMMAND - 2) else if (inbound_count < MAX_CURLY_COMMAND - 2)
inbound_buffer[inbound_count++] = is_lcd ? c : b; // Buffer while space remains inbound_buffer[inbound_count++] = is_lcd ? c : b; // Buffer while space remains