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

Loading…
Cancel
Save