[Colorlcd] Support model notes with spaces and prevent radio crash due to filename (#645)
* support both versions of model notes file name. Fix for #641 * Adding support for names with spaces * Fix compilation
This commit is contained in:
@@ -830,7 +830,13 @@ bool isTrainerModeAvailable(int mode)
|
||||
bool modelHasNotes()
|
||||
{
|
||||
char filename[sizeof(MODELS_PATH)+1+sizeof(g_model.header.name)+sizeof(TEXT_EXT)] = MODELS_PATH "/";
|
||||
char *buf = strcat_currentmodelname(&filename[sizeof(MODELS_PATH)]);
|
||||
char *buf = strcat_currentmodelname(&filename[sizeof(MODELS_PATH)], 0);
|
||||
strcpy(buf, TEXT_EXT);
|
||||
if (isFileAvailable(filename)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
buf = strcat_currentmodelname(&filename[sizeof(MODELS_PATH)], ' ');
|
||||
strcpy(buf, TEXT_EXT);
|
||||
if (isFileAvailable(filename)) {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user