1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-15 04:15:26 +03:00

Should fix the problem with the bootloader flash (file extension search

was wrong)
This commit is contained in:
bsongis 2015-03-24 19:41:33 +01:00
parent 360356b7e4
commit 9ccb7e672f
2 changed files with 4 additions and 3 deletions

View file

@ -207,8 +207,9 @@ char *strAppendFilename(char *dest, const char *filename, const int size)
#define LEN_FILE_EXTENSION 4
char *getFileExtension(char *filename, int size)
{
for (int i=0; i<size-LEN_FILE_EXTENSION; ++i) {
if (filename[i] == '.' || filename[i] == '\0') {
int len = min<int>(size, strlen(filename));
for (int i=len; i>=len-LEN_FILE_EXTENSION; --i) {
if (filename[i] == '.') {
return &filename[i];
}
}