Updated due to changes to the monthNumTo3LetterAbbreviation function's prototype

This commit is contained in:
anschrammh 2020-12-15 00:12:33 +01:00
parent 2b0698c7d0
commit 89ee88530e

View File

@ -844,11 +844,11 @@ class FTPServer : public TCPServer<T>
//We try to retrieve the last modification date
const time_t fileModifDate = fileOrDir.getLastWrite();
struct tm *timeP = localtime(&fileModifDate);
//Buffer necessary to store the month's three letter abbreviation
char month[4] = "";
//We get the month's three letter abbreviation
uint32_t monthAbbreviation = monthNumTo3LetterAbbreviation(timeP->tm_mon + 1); //+1 because in the tm struct, month goes from 0 to 11 ...
#ifdef DEBUG_FTPS
Serial.printf("Filename : %s, %s %d %d %d:%d\n", fileOrDir.name(), monthNumTo3LetterAbbreviation(month, timeP->tm_mon), timeP->tm_mon, timeP->tm_mday, timeP->tm_hour, timeP->tm_min);
Serial.printf("Filename : %s, %s %d %d %d:%d\n", fileOrDir.name(), (char *)&monthAbbreviation, timeP->tm_mon, timeP->tm_mday, timeP->tm_hour, timeP->tm_min);
#endif
char zero_prepended[3][3] = {"","",""};
@ -856,7 +856,7 @@ class FTPServer : public TCPServer<T>
client->_dataClient.printf("%crwxrwxrwx 1 owner esp8266 %d %s %s %s:%s %s\r\n",
fileOrDir.isDirectory() ? 'd' : '-',
fileOrDir.isDirectory() ? 0 : fileOrDir.size(),
monthNumTo3LetterAbbreviation(month, timeP->tm_mon + 1), //+1 because in the tm struct, month goes from 0 to 11 ...
(char *)&monthAbbreviation,
dateTimeFormater(zero_prepended[0],timeP->tm_mday,'0'),
dateTimeFormater(zero_prepended[1],!timeP->tm_hour ? 23 : timeP->tm_hour-1 ,'0'),
dateTimeFormater(zero_prepended[2],timeP->tm_min,'0'),