diff --git a/src/sys/ubixfs/ubixfs.c b/src/sys/ubixfs/ubixfs.c index 2cba578..737ee5a 100644 --- a/src/sys/ubixfs/ubixfs.c +++ b/src/sys/ubixfs/ubixfs.c @@ -81,11 +81,8 @@ initUbixFS(struct mountPoints *mp) { struct ubixFSInfo *fsInfo = 0x0; int size; - /* assert(mp->fsInfo != NULL); */ - if (mp == NULL) { - kprintf("\nAssertion error in %s:%d\n", __FILE__, __LINE__); - } + assert(mp); mp->fsInfo = (struct ubixFSInfo *)kmalloc(sizeof(struct ubixFSInfo)); @@ -136,11 +133,6 @@ assert(fd->mp->device->devInfo); assert(fd->mp->device->devInfo->read); - if (fd == NULL || fd->mp == NULL || fd->mp->device == NULL || - fd->mp->device->devInfo == NULL || fd->mp->device->devInfo->read == NULL){ - kprintf("\nAssertion error in %s:%d\n", __FILE__, __LINE__); - } - if (file[0] == '/' && file[1] != '\0') file++; fd->mp->device->devInfo->read(fd->mp->device->devInfo->info, @@ -184,15 +176,21 @@ } } kfree(dirEntry); - return((int)0); + return(0); } int writeFileByte(int ch, fileDescriptor *fd, long offset) { - int blockCount = 0x0,batIndex = 0x0,batIndexPrev = fd->start,i = 0x0; + int blockCount = 0x0,batIndex = 0x0,batIndexPrev = 0x0,i = 0x0; struct directoryEntry *dirEntry = 0x0; - struct ubixFSInfo *fsInfo = fd->mp->fsInfo; + struct ubixFSInfo *fsInfo = NULL; + + assert(fd); + assert(fd->mp); + + batIndexPrev = fd->start; + fsInfo = fd->mp->fsInfo; /* Find Out How Many Blocks Long This File Is */ blockCount = (offset/4096);