Fix empty paths

This commit is contained in:
Crementif 2022-07-27 16:55:41 +02:00 committed by Maschell
parent aec8cd6957
commit e1274af0ea

View File

@ -16,11 +16,17 @@ __fsa_fixpath(struct _reent *r,
p = (char *) path; p = (char *) path;
} }
if (strlen(p) > FS_MAX_PATH) { uint32_t sizePath = strlen(p);
if (sizePath > FS_MAX_PATH) {
r->_errno = ENAMETOOLONG; r->_errno = ENAMETOOLONG;
return nullptr; return nullptr;
} }
if (sizePath == 0) {
r->_errno = ENOENT;
return nullptr;
}
fixedPath = (char *) memalign(0x40, FS_MAX_PATH + 1); fixedPath = (char *) memalign(0x40, FS_MAX_PATH + 1);
if (!fixedPath) { if (!fixedPath) {
r->_errno = ENOMEM; r->_errno = ENOMEM;