Browse Source

Patch SD file draw bug

Scott Lahteine 7 years ago
parent
commit
dac5f20a01
1 changed files with 3 additions and 2 deletions
  1. 3
    2
      Marlin/ultralcd_impl_DOGM.h

+ 3
- 2
Marlin/ultralcd_impl_DOGM.h View File

@@ -918,14 +918,15 @@ static void lcd_implementation_status_screen() {
918 918
       if (!PAGE_CONTAINS(row_y1, row_y2)) return;
919 919
 
920 920
       uint8_t n = LCD_WIDTH - (START_COL) - 1;
921
+      char c;
921 922
       if (longFilename[0]) {
922 923
         filename = longFilename;
923
-        longFilename[n] = '\0';
924
+        longFilename[n] = '\0'; // cutoff at screen edge
924 925
       }
925 926
 
926 927
       if (isDir) lcd_print(LCD_STR_FOLDER[0]);
927 928
 
928
-      while (char c = *filename) {
929
+      while ((c = *filename) && n > 0) {
929 930
         n -= lcd_print_and_count(c);
930 931
         filename++;
931 932
       }

Loading…
Cancel
Save