[prev in list] [next in list] [prev in thread] [next in thread] 

List:       rockbox-cvs
Subject:    gevaerts: r24105 - trunk/firmware/common
From:       mailer () svn ! rockbox ! org
Date:       2009-12-23 21:51:29
Message-ID: 200912232151.nBNLpTKJ007956 () giant ! haxx ! se
[Download RAW message or body]

Date: 2009-12-23 22:51:29 +0100 (Wed, 23 Dec 2009)
New Revision: 24105

Log Message:
only get the file pointer if fd is actually valid.


Modified:
   trunk/firmware/common/file.c

Modified: trunk/firmware/common/file.c
===================================================================
--- trunk/firmware/common/file.c	2009-12-23 21:47:45 UTC (rev 24104)
+++ trunk/firmware/common/file.c	2009-12-23 21:51:29 UTC (rev 24105)
@@ -485,13 +485,16 @@
 {
     long sectors;
     long nread=0;
-    struct filedesc* file = &openfiles[fd];
+    struct filedesc* file;
     int rc;
 
     if (fd < 0 || fd > MAX_OPEN_FILES-1) {
         errno = EINVAL;
         return -1;
     }
+
+    file = &openfiles[fd];
+
     if ( !file->busy ) {
         errno = EBADF;
         return -1;

_______________________________________________
rockbox-cvs mailing list
rockbox-cvs@cool.haxx.se
http://cool.haxx.se/cgi-bin/mailman/listinfo/rockbox-cvs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic