Bläddra i källkod

Merge pull request #8314 from thinkyhead/bf2_sprintf_p_fix

[2.0] Patch abuse of sprintf_P in G33
Scott Lahteine 7 år sedan
förälder
incheckning
a34b5a2bfa
Inget konto är kopplat till bidragsgivarens mejladress
1 ändrade filer med 4 tillägg och 4 borttagningar
  1. 4
    4
      Marlin/src/gcode/calibrate/G33.cpp

+ 4
- 4
Marlin/src/gcode/calibrate/G33.cpp Visa fil

649
           }
649
           }
650
         SERIAL_EOL();
650
         SERIAL_EOL();
651
         char mess[21];
651
         char mess[21];
652
-        sprintf_P(mess, PSTR("Calibration sd:"));
652
+        strcpy_P(mess, PSTR("Calibration sd:"));
653
         if (zero_std_dev_min < 1)
653
         if (zero_std_dev_min < 1)
654
           sprintf_P(&mess[15], PSTR("0.%03i"), (int)round(zero_std_dev_min * 1000.0));
654
           sprintf_P(&mess[15], PSTR("0.%03i"), (int)round(zero_std_dev_min * 1000.0));
655
         else
655
         else
664
         if (iterations < 31)
664
         if (iterations < 31)
665
           sprintf_P(mess, PSTR("Iteration : %02i"), (int)iterations);
665
           sprintf_P(mess, PSTR("Iteration : %02i"), (int)iterations);
666
         else
666
         else
667
-          sprintf_P(mess, PSTR("No convergence"));
667
+          strcpy_P(mess, PSTR("No convergence"));
668
         SERIAL_PROTOCOL(mess);
668
         SERIAL_PROTOCOL(mess);
669
         SERIAL_PROTOCOL_SP(32);
669
         SERIAL_PROTOCOL_SP(32);
670
         SERIAL_PROTOCOLPGM("std dev:");
670
         SERIAL_PROTOCOLPGM("std dev:");
683
       SERIAL_EOL();
683
       SERIAL_EOL();
684
 
684
 
685
       char mess[21];
685
       char mess[21];
686
-      sprintf_P(mess, enddryrun);
687
-      sprintf_P(&mess[11], PSTR(" sd:"));
686
+      strcpy_P(mess, enddryrun);
687
+      strcpy_P(&mess[11], PSTR(" sd:"));
688
       if (zero_std_dev < 1)
688
       if (zero_std_dev < 1)
689
         sprintf_P(&mess[15], PSTR("0.%03i"), (int)round(zero_std_dev * 1000.0));
689
         sprintf_P(&mess[15], PSTR("0.%03i"), (int)round(zero_std_dev * 1000.0));
690
       else
690
       else

Laddar…
Avbryt
Spara