|
@@ -110,8 +110,8 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m
|
110
|
110
|
createFilename(dosFilename, p);
|
111
|
111
|
|
112
|
112
|
// Allocate enough stack space for the full path to a folder, trailing slash, and nul
|
113
|
|
- bool prepend_is_empty = (prepend[0] == '\0');
|
114
|
|
- int len = (prepend_is_empty ? 1 : strlen(prepend)) + strlen(dosFilename) + 1 + 1;
|
|
113
|
+ const bool prepend_is_empty = (!prepend || prepend[0] == '\0');
|
|
114
|
+ const int len = (prepend_is_empty ? 1 : strlen(prepend)) + strlen(dosFilename) + 1 + 1;
|
115
|
115
|
char path[len];
|
116
|
116
|
|
117
|
117
|
// Append the FOLDERNAME12/ to the passed string.
|