[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:
eshifri
2021-09-02 10:45:58 +10:00
committed by GitHub
parent 9a2461c7e9
commit 88b8ac86fb
5 changed files with 58 additions and 10 deletions
+2 -2
View File
@@ -128,7 +128,7 @@ uint8_t zlen(const char * str, uint8_t size)
return 0;
}
char * strcat_zchar(char * dest, const char * name, uint8_t size, const char * defaultName, uint8_t defaultNameSize, uint8_t defaultIdx)
char * strcat_zchar(char * dest, const char * name, uint8_t size, const char spaceSym, const char * defaultName, uint8_t defaultNameSize, uint8_t defaultIdx)
{
int8_t len = 0;
@@ -142,7 +142,7 @@ char * strcat_zchar(char * dest, const char * name, uint8_t size, const char * d
if (!len && dest[i])
len = i+1;
if (len) {
if (!dest[i])
if (dest[i] == spaceSym)
dest[i] = '_';
}
i--;