diff --git a/src/app/definition.cpp b/src/app/definition.cpp index 0d39331..e474f44 100644 --- a/src/app/definition.cpp +++ b/src/app/definition.cpp @@ -68,7 +68,10 @@ char *lastIndexOf(char *str, const char character) return last; } - +/** + * The monthNumTo3LetterAbbreviation function takes the month number from 1 to 12 and returns the abbreviation in a 3 letter + * format. + */ char *monthNumTo3LetterAbbreviation(char *buffer, const uint8_t monthNumber) { static const char monthArray[][4] = {{"Jan"},{"Feb"},{"Mar"},{"Apr"},{"May"},{"Jun"},{"Jul"},{"Aug"},{"Sep"},{"Oct"},{"Nov"},{"Dec"}}; @@ -77,7 +80,7 @@ char *monthNumTo3LetterAbbreviation(char *buffer, const uint8_t monthNumber) if(monthNumber >= 1 && monthNumber <= 12) strcpy_P(buffer, monthArray[monthNumber-1]); - else //Default is january + else //If the month number is garbage, we return the first month of the year strcpy_P(buffer, monthArray[0]); return buffer;