Removed the lastIndexOf function returning the last occurence of a character in a string, using builtin strrchr instead
This commit is contained in:
parent
df4159668c
commit
4a7765fc35
@ -50,24 +50,6 @@ char *dateTimeFormater(char *pointer, const uint8_t value, const char character)
|
|||||||
return pointer;
|
return pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *lastIndexOf(char *str, const char character)
|
|
||||||
{
|
|
||||||
char *last(NULL), *current(str);
|
|
||||||
do
|
|
||||||
{
|
|
||||||
current = strchr(current, character);
|
|
||||||
if(current != NULL)
|
|
||||||
{
|
|
||||||
last = current;
|
|
||||||
if(*(current+1) == '\0')break;
|
|
||||||
|
|
||||||
current += 1;
|
|
||||||
}
|
|
||||||
}while(current != NULL);
|
|
||||||
|
|
||||||
return last;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The monthNumTo3LetterAbbreviation function takes the month number from 1 to 12 and returns the abbreviation in a 3 letter
|
* The monthNumTo3LetterAbbreviation function takes the month number from 1 to 12 and returns the abbreviation in a 3 letter
|
||||||
* format.
|
* format.
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
|
||||||
char *addChar(char *pointer, const char character);
|
char *addChar(char *pointer, const char character);
|
||||||
char *lastIndexOf(char *str, const char character);
|
|
||||||
char *dateTimeFormater(char *pointer, const uint8_t value, const char character);
|
char *dateTimeFormater(char *pointer, const uint8_t value, const char character);
|
||||||
uint32_t monthNumTo3LetterAbbreviation(const uint8_t monthNumber);
|
uint32_t monthNumTo3LetterAbbreviation(const uint8_t monthNumber);
|
||||||
#endif // UTILITIES_H
|
#endif // UTILITIES_H
|
||||||
|
Loading…
Reference in New Issue
Block a user