Fix empty paths

This commit is contained in:
Crementif 2022-07-27 16:55:41 +02:00
parent e8c79ee85d
commit 24df55f2f7

View File

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