Search
lxdream.org :: lxdream/src/mem.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/mem.c
changeset 72:ceb5985fa8d8
prev50:704b11c879cb
next146:f91fa34ab219
author nkeynes
date Tue Jan 10 14:00:00 2006 +0000 (14 years ago)
permissions -rw-r--r--
last change Limit block loads to file size
file annotate diff log raw
1.1 --- a/src/mem.c Wed Dec 28 22:47:44 2005 +0000
1.2 +++ b/src/mem.c Tue Jan 10 14:00:00 2006 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: mem.c,v 1.10 2005-12-28 22:47:44 nkeynes Exp $
1.6 + * $Id: mem.c,v 1.11 2006-01-10 14:00:00 nkeynes Exp $
1.7 * mem.c is responsible for creating and maintaining the overall system memory
1.8 * map, as visible from the SH4 processor.
1.9 *
1.10 @@ -200,7 +200,7 @@
1.11 if( f == NULL )
1.12 return errno;
1.13 fstat( fileno(f), &st );
1.14 - if( length == 0 || length == -1 )
1.15 + if( length == 0 || length == -1 || length > st.st_size )
1.16 length = st.st_size;
1.17
1.18 while( total < length ) {
.