- remove bug in initrd_read

=> fix the using of the argument "offset" 


git-svn-id: http://svn.lfbs.rwth-aachen.de/svn/scc/trunk/MetalSVM@377 315a16e6-25f9-4109-90ae-ca3045a26c18
This commit is contained in:
stefan 2011-01-19 17:12:20 +00:00
parent 2bfc5a49dc
commit 98769944c8

View file

@ -50,12 +50,16 @@ typedef struct {
static ssize_t initrd_read(vfs_node_t* node, uint8_t* buffer, size_t size, off_t offset)
{
uint32_t i, pos, found = 0;
uint32_t i, pos = 0, found = 0;
char* data = NULL;
block_list_t* blist = &node->block_list;
/* searching for the valid data block */
pos = offset ? node->block_size / offset : 0;
if (offset) {
pos = offset / node->block_size;
offset = offset % node->block_size;
}
do {
for(i=0; i<MAX_DATABLOCKS && !data; i++) {
if (blist->data[i]) {