diff options
Diffstat (limited to 'firmware/test/fat/main.c')
-rw-r--r-- | firmware/test/fat/main.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/firmware/test/fat/main.c b/firmware/test/fat/main.c index 0cf06bdac3..5490fa9777 100644 --- a/firmware/test/fat/main.c +++ b/firmware/test/fat/main.c | |||
@@ -111,15 +111,19 @@ void dbg_type(char* name) | |||
111 | DEBUGF("Got file descriptor %d\n",fd); | 111 | DEBUGF("Got file descriptor %d\n",fd); |
112 | 112 | ||
113 | for (i=0;i<5;i++) { | 113 | for (i=0;i<5;i++) { |
114 | rc = read(fd, buf, SECTOR_SIZE/3); | 114 | rc = read(fd, buf, SECTOR_SIZE*2/3); |
115 | if( rc >= 0 ) | 115 | if( rc > 0 ) |
116 | { | 116 | { |
117 | buf[SECTOR_SIZE]=0; | 117 | buf[rc]=0; |
118 | DEBUGF("%d: %d\n", i, rc); | 118 | printf("%d: %s\n", i, buf); |
119 | } | ||
120 | else if ( rc == 0 ) { | ||
121 | DEBUGF("EOF\n"); | ||
122 | break; | ||
119 | } | 123 | } |
120 | else | 124 | else |
121 | { | 125 | { |
122 | DEBUGF("Failed reading file\n"); | 126 | DEBUGF("Failed reading file: %d\n",rc); |
123 | } | 127 | } |
124 | } | 128 | } |
125 | close(fd); | 129 | close(fd); |
@@ -218,6 +222,7 @@ int main(int argc, char *argv[]) | |||
218 | } | 222 | } |
219 | 223 | ||
220 | dbg_console(); | 224 | dbg_console(); |
225 | |||
221 | return 0; | 226 | return 0; |
222 | } | 227 | } |
223 | 228 | ||