mirror of
https://gitlab.com/qemu-project/openbios.git
synced 2024-02-13 08:34:06 +08:00
load: manage file size smaller than 512 bytes
Allow to load bootinfo scripts of haiku and FreeBSD. Signed-off-by: Laurent Vivier <Laurent@vivier.eu> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@593 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
@@ -259,11 +259,13 @@ files_load( files_info_t *mi)
|
||||
size = 0;
|
||||
while(1) {
|
||||
ret = mi->fs->read( mi->file, buf, 512 );
|
||||
if (ret != 512)
|
||||
if (ret <= 0)
|
||||
break;
|
||||
buf += ret;
|
||||
mi->filepos += ret;
|
||||
size += ret;
|
||||
if (ret != 512)
|
||||
break;
|
||||
}
|
||||
PUSH( size );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user