Browse Source

Merge pull request #1017 from foosel/fix/checksum_truncation_bug

Fix for a wrong checksum truncation for certain commands
daid 10 years ago
parent
commit
c13a831ea1
1 changed files with 6 additions and 6 deletions
  1. 6
    6
      Marlin/Marlin_main.cpp

+ 6
- 6
Marlin/Marlin_main.cpp View File

@@ -1730,7 +1730,7 @@ void process_commands()
1730 1730
     case 23: //M23 - Select file
1731 1731
       starpos = (strchr(strchr_pointer + 4,'*'));
1732 1732
       if(starpos!=NULL)
1733
-        *(starpos-1)='\0';
1733
+        *(starpos)='\0';
1734 1734
       card.openFile(strchr_pointer + 4,true);
1735 1735
       break;
1736 1736
     case 24: //M24 - Start SD print
@@ -1753,7 +1753,7 @@ void process_commands()
1753 1753
       if(starpos != NULL){
1754 1754
         char* npos = strchr(cmdbuffer[bufindr], 'N');
1755 1755
         strchr_pointer = strchr(npos,' ') + 1;
1756
-        *(starpos-1) = '\0';
1756
+        *(starpos) = '\0';
1757 1757
       }
1758 1758
       card.openFile(strchr_pointer+4,false);
1759 1759
       break;
@@ -1768,7 +1768,7 @@ void process_commands()
1768 1768
         if(starpos != NULL){
1769 1769
           char* npos = strchr(cmdbuffer[bufindr], 'N');
1770 1770
           strchr_pointer = strchr(npos,' ') + 1;
1771
-          *(starpos-1) = '\0';
1771
+          *(starpos) = '\0';
1772 1772
         }
1773 1773
         card.removeFile(strchr_pointer + 4);
1774 1774
       }
@@ -1790,7 +1790,7 @@ void process_commands()
1790 1790
         namestartpos++; //to skip the '!'
1791 1791
 
1792 1792
       if(starpos!=NULL)
1793
-        *(starpos-1)='\0';
1793
+        *(starpos)='\0';
1794 1794
 
1795 1795
       bool call_procedure=(code_seen('P'));
1796 1796
 
@@ -1813,7 +1813,7 @@ void process_commands()
1813 1813
       if(starpos != NULL){
1814 1814
         char* npos = strchr(cmdbuffer[bufindr], 'N');
1815 1815
         strchr_pointer = strchr(npos,' ') + 1;
1816
-        *(starpos-1) = '\0';
1816
+        *(starpos) = '\0';
1817 1817
       }
1818 1818
       card.openLogFile(strchr_pointer+5);
1819 1819
       break;
@@ -2233,7 +2233,7 @@ void process_commands()
2233 2233
     case 117: // M117 display message
2234 2234
       starpos = (strchr(strchr_pointer + 5,'*'));
2235 2235
       if(starpos!=NULL)
2236
-        *(starpos-1)='\0';
2236
+        *(starpos)='\0';
2237 2237
       lcd_setstatus(strchr_pointer + 5);
2238 2238
       break;
2239 2239
     case 114: // M114

Loading…
Cancel
Save