Include space for the terminating nul in lsDive
This commit is contained in:
parent
f3c1a6b19c
commit
417706e578
1 changed files with 1 additions and 1 deletions
|
@ -62,7 +62,7 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m
|
||||||
|
|
||||||
// Allocate enough stack space for the full path to a folder, trailing slash, and nul
|
// Allocate enough stack space for the full path to a folder, trailing slash, and nul
|
||||||
boolean prepend_is_empty = (prepend[0] == '\0');
|
boolean prepend_is_empty = (prepend[0] == '\0');
|
||||||
int len = strlen(prepend) + (prepend_is_empty ? 1 : 0) + strlen(lfilename) + 1;
|
int len = strlen(prepend) + (prepend_is_empty ? 1 : 0) + strlen(lfilename) + 1 + 1;
|
||||||
char path[len];
|
char path[len];
|
||||||
|
|
||||||
// Append the FOLDERNAME12/ to the passed string.
|
// Append the FOLDERNAME12/ to the passed string.
|
||||||
|
|
Reference in a new issue