Browse Source

Use only as much stack as needed for the M23 command

Scott Lahteine 9 years ago
parent
commit
6b01cf07c2
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      Marlin/cardreader.cpp

+ 1
- 1
Marlin/cardreader.cpp View File

@@ -266,7 +266,7 @@ void CardReader::release() {
266 266
 }
267 267
 
268 268
 void CardReader::openAndPrintFile(const char *name) {
269
-  char cmd[4 + (FILENAME_LENGTH + 1) * MAX_DIR_DEPTH + 2]; // Room for "M23 ", names with slashes, a null, and one extra
269
+  char cmd[4 + strlen(name) + 1]; // Room for "M23 ", filename, and null
270 270
   sprintf_P(cmd, PSTR("M23 %s"), name);
271 271
   for (char *c = &cmd[4]; *c; c++) *c = tolower(*c);
272 272
   enqueue_and_echo_command_now(cmd);

Loading…
Cancel
Save