smuehlst / circle-stdlib

Standard C and C++ Library Support for Circle
GNU General Public License v3.0
90 stars 17 forks source link

fopen returns non-NULL on non-existing file #14

Closed olfp closed 3 years ago

olfp commented 3 years ago

Environment: circle-stdlib v15.3 When I try to open a non-existing file, the "fopen" call wrongly returns a non-NULL value.

Verification: I modified sample 03-stdio-fatfs to use the name of a non-existing file for the fp = fopen(..., "r") call. Printing the value of fp via printf("...%p", fp) reveals a non-NULL value (for example on my Pi 3B+ always 0x5172cc). Also, errno is not set, i.e. 0.

Code: FILE* fp = fopen("error.txt", "r"); printf("fopen returns: %p, errno is: %d\n", fp, errno);

Result: open returns: 0x5172cc, errno is: 0

smuehlst commented 3 years ago

Thanks for the report, nice catch. This is now fixed in release v15.4.