Skip to content

Example code writefile() and appendfile() #17

@jfseaman

Description

@jfseaman

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. ;)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions