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

Example code writefile() and appendfile() #17

Open
jfseaman opened this issue Aug 15, 2024 · 0 comments
Open

Example code writefile() and appendfile() #17

jfseaman opened this issue Aug 15, 2024 · 0 comments

Comments

@jfseaman
Copy link

In PSRamFS_Test.ino lines:
191: if( file.write( (const uint8_t*)message, strlen(message)+1 ) ) {
214: if( file.write( (const uint8_t*)message, strlen(message)+1 ) ){

The "+1" causes writing of buffer contents to include the buffer terminating NULL (\0).
This may be intentional by the CO (code originator).

It caused me some thinking on why there were extra characters returned from readfile.

It was a common "error" for my "C" students in the 80's writing in K&R C on MS-DOS and CP/M systems. ;)

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

1 participant