Selaa lähdekoodia

Include space for the terminating nul in lsDive

Scott Lahteine 10 vuotta sitten
vanhempi
commit
417706e578
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1
    1
      Marlin/cardreader.cpp

+ 1
- 1
Marlin/cardreader.cpp Näytä tiedosto

@@ -62,7 +62,7 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m
62 62
 
63 63
       // Allocate enough stack space for the full path to a folder, trailing slash, and nul
64 64
       boolean prepend_is_empty = (prepend[0] == '\0');
65
-      int len = strlen(prepend) + (prepend_is_empty ? 1 : 0) + strlen(lfilename) + 1;
65
+      int len = strlen(prepend) + (prepend_is_empty ? 1 : 0) + strlen(lfilename) + 1 + 1;
66 66
       char path[len];
67 67
 
68 68
       // Append the FOLDERNAME12/ to the passed string.

Loading…
Peruuta
Tallenna