Reduce a few magic numbers for FILENAME_LENGTH

flash: 0
RAM: 0
This commit is contained in:
Guðni Már Gilbert 2022-02-15 06:36:49 +00:00 committed by Alex Voinea
parent 22582e560e
commit 7d86a0d121
4 changed files with 4 additions and 4 deletions

View File

@ -11313,7 +11313,7 @@ void restore_print_from_eeprom(bool mbl_was_active) {
int feedmultiply_rec;
uint8_t fan_speed_rec;
char cmd[48];
char filename[13];
char filename[FILENAME_LENGTH];
uint8_t depth = 0;
char dir_name[9];

View File

@ -1015,7 +1015,7 @@ void SdBaseFile::printFatTime( uint16_t fatTime) {
* the value zero, false, is returned for failure.
*/
bool SdBaseFile::printName() {
char name[13];
char name[FILENAME_LENGTH];
if (!getFilename(name)) return false;
MYSERIAL.print(name);
return true;

View File

@ -304,7 +304,7 @@ void CardReader::getAbsFilename(char *t)
while(*t!=0 && cnt< MAXPATHNAMELENGTH)
{t++;cnt++;} //crawl counter forward.
}
if(cnt<MAXPATHNAMELENGTH-13)
if(cnt < MAXPATHNAMELENGTH - FILENAME_LENGTH)
file.getFilename(t);
else
t[0]=0;

View File

@ -89,7 +89,7 @@ public:
bool logging;
bool sdprinting ;
bool cardOK ;
char filename[13];
char filename[FILENAME_LENGTH];
// There are scenarios when simple modification time is not enough (on MS Windows)
// Therefore these timestamps hold the most recent one of creation/modification date/times
uint16_t crmodTime, crmodDate;