Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An omission in the example: ReadCsvFile.ino #495

Open
Janovlk opened this issue Oct 2, 2024 · 1 comment
Open

An omission in the example: ReadCsvFile.ino #495

Janovlk opened this issue Oct 2, 2024 · 1 comment

Comments

@Janovlk
Copy link

Janovlk commented Oct 2, 2024

Hello,

when checking the last token in the line, there should be the "\n" delimiter as the token now ends with the LF character. The CR character was already removed by Fgets function.

str = strtok(nullptr, ",");

This example works as the Strtod function stops when encounters a non-number character. But if someone modifies it and a string have to be read here, then this string will end with the LF character. It can cause problems afterwards.

Thank you for your work.

@greiman
Copy link
Owner

greiman commented Oct 6, 2024

I will put it on the todo for SdFat beta and it will eventually get to release. I don't do minor fixes to the release version since Arduino forces all users to update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants