The instruction FAT_setAttr gives "dsi exeption" in all the last versions (1.10.11-13) of libfat.
This is due to a bug in FAT_setAttr (fatfile.c): a NULL pointer is passed to _FAT_directory_entryFromPath which expects a pointer to a variable.
Moreover there is another bug. The code does take into account the endianess of powerPC and therefore the attr variable is always passed with a 0 value.
This code solves both the issues (NEW indicates the new lines).
int FAT_setAttr(const char *file, int attr) {
// Defines...
DIR_ENTRY_POSITION entryEnd;
PARTITION *partition = NULL;
DIR_ENTRY* dirEntry = NULL;
DIR_ENTRY dirEntry_variable; //NEW
char attr_byte; //NEW
dirEntry =&dirEntry_variable; //NEW
attr_byte= (char) attr; //NEW
...
// Write Data
_FAT_cache_writePartialSector (
partition->cache // Cache to write
, &attr_byte // Value to be written ----> NEW
, _FAT_fat_clusterToSector( partition , entryEnd.cluster ) + entryEnd.sector // cluster
, entryEnd.offset * DIR_ENTRY_DATA_SIZE + DIR_ENTRY_attributes // offset
, 1 // Size in bytes
);
[libfat] FAT_setAttr dsi exception
Re: [libfat] FAT_setAttr dsi exception
The issue was fixed by Wintermute with 2 patches
Who is online
Users browsing this forum: No registered users and 11 guests