mirror of
https://github.com/wiiu-env/libfat.git
synced 2024-11-22 01:49:17 +01:00
Merge pull request #9 from Nebuleon/patch
An unsigned char fix and an errno change
This commit is contained in:
commit
d4926573ac
@ -98,7 +98,8 @@ static int _FAT_directory_lfnLength (const char* name) {
|
||||
}
|
||||
// Make sure the name doesn't contain any control codes or codes not representable in UCS-2
|
||||
for (i = 0; i < nameLength; i++) {
|
||||
if (name[i] < 0x20 || name[i] >= ABOVE_UCS_RANGE) {
|
||||
unsigned char ch = (unsigned char) name[i];
|
||||
if (ch < 0x20 || ch >= ABOVE_UCS_RANGE) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ int _FAT_unlink_r (struct _reent *r, const char *path) {
|
||||
if (!_FAT_directory_isDot (&dirContents)) {
|
||||
// The directory had something in it that isn't a reference to itself or it's parent
|
||||
_FAT_unlock(&partition->lock);
|
||||
r->_errno = EPERM;
|
||||
r->_errno = ENOTEMPTY;
|
||||
return -1;
|
||||
}
|
||||
nextEntry = _FAT_directory_getNextEntry (partition, &dirContents);
|
||||
@ -588,7 +588,6 @@ int _FAT_dirnext_r (struct _reent *r, DIR_ITER *dirState, char *filename, struct
|
||||
// Make sure there is another file to report on
|
||||
if (! state->validEntry) {
|
||||
_FAT_unlock(&state->partition->lock);
|
||||
r->_errno = ENOENT;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user