libctru icon indicating copy to clipboard operation
libctru copied to clipboard

`stat()` on empty path returns `0` instead of `-1`

Open timschumi opened this issue 3 years ago • 0 comments

#include <sys/stat.h>

int main() {
    // <snip>

    struct stat st;
    if (stat("", &st) == 0)
        // <do something>

    // <snip>
}

Personally, I tested this by using one of the examples from 3ds-examples, putting the code above right at the beginning and shutting down/exiting the application if the return code is zero.

timschumi avatar Jul 16 '21 18:07 timschumi