mirror of
https://github.com/wiiu-env/libmocha.git
synced 2024-11-19 09:59:33 +01:00
Fix empty paths
This commit is contained in:
parent
aec8cd6957
commit
e1274af0ea
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user