write_command changes input

This commit is contained in:
Scott Lahteine 2021-04-05 15:34:51 -05:00 committed by Scott Lahteine
parent f3510db367
commit c5ab0a66b7
2 changed files with 5 additions and 5 deletions

View File

@ -722,10 +722,10 @@ void CardReader::report_status() {
SERIAL_ECHOLNPGM(STR_SD_NOT_PRINTING); SERIAL_ECHOLNPGM(STR_SD_NOT_PRINTING);
} }
void CardReader::write_command(const char * const buf) { void CardReader::write_command(char * const buf) {
char *begin = buf; char *begin = buf,
char *npos = nullptr; *npos = nullptr,
char *end = buf + strlen(buf) - 1; *end = buf + strlen(buf) - 1;
file.writeError = false; file.writeError = false;
if ((npos = strchr(buf, 'N'))) { if ((npos = strchr(buf, 'N'))) {

View File

@ -92,7 +92,7 @@ public:
// SD Card Logging // SD Card Logging
static void openLogFile(const char * const path); static void openLogFile(const char * const path);
static void write_command(const char * const buf); static void write_command(char * const buf);
#if DISABLED(NO_SD_AUTOSTART) // Auto-Start auto#.g file handling #if DISABLED(NO_SD_AUTOSTART) // Auto-Start auto#.g file handling
static uint8_t autofile_index; // Next auto#.g index to run, plus one. Ignored by autofile_check when zero. static uint8_t autofile_index; // Next auto#.g index to run, plus one. Ignored by autofile_check when zero.