Skip to content

fix(radio): remove invalid characters from logs filename.#5129

Merged
pfeerick merged 2 commits into
mainfrom
philmoz/sanitize-logs-filename
Jun 6, 2024
Merged

fix(radio): remove invalid characters from logs filename.#5129
pfeerick merged 2 commits into
mainfrom
philmoz/sanitize-logs-filename

Conversation

@philmoz
Copy link
Copy Markdown
Collaborator

@philmoz philmoz commented Jun 6, 2024

Fixes #5128

Logging uses model name to create log file - model name can include characters that are not valid in a filename on the radio.

@pfeerick
Copy link
Copy Markdown
Member

pfeerick commented Jun 6, 2024

Was just looking at this... perhaps worth doing as a helper function in sdcard.cpp? isFileAvailable() is there already... maybe either another function isValidFsChar()? that just does the letter by letter check or a sanitiseFilename() type one that does that entire check itself and returns a sanitised/valid filename? Are there will probably be other places we need to be doing this at some point... if not now.

@pfeerick pfeerick added the bug 🪲 Something isn't working label Jun 6, 2024
@pfeerick pfeerick added this to the 2.10.2 milestone Jun 6, 2024
@philmoz
Copy link
Copy Markdown
Collaborator Author

philmoz commented Jun 6, 2024

I've added a helper function in strhelpers.cpp so it can use the existing temp buffer.
Also cleaned up the log filename creation code.

Copy link
Copy Markdown
Member

@pfeerick pfeerick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM on TPro with 5" Quad

@pfeerick pfeerick merged commit 8e64c3b into main Jun 6, 2024
@pfeerick pfeerick deleted the philmoz/sanitize-logs-filename branch June 6, 2024 12:20
JunOllyLi pushed a commit to JunOllyLi/edgetx_muffin that referenced this pull request Mar 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 🪲 Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Using the " symbol in model name causing SD card error when enabling SD logging.

2 participants