diff options
Diffstat (limited to 'firmware/disk.c')
-rw-r--r-- | firmware/disk.c | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/firmware/disk.c b/firmware/disk.c index c32a39be41..acd765bab8 100644 --- a/firmware/disk.c +++ b/firmware/disk.c | |||
@@ -23,40 +23,6 @@ | |||
23 | #include "debug.h" | 23 | #include "debug.h" |
24 | #include "panic.h" | 24 | #include "panic.h" |
25 | 25 | ||
26 | void read_file_into_buffer( char **buf, const char *filename ) | ||
27 | { | ||
28 | int i; | ||
29 | FILE *fp; | ||
30 | int count = 0; | ||
31 | |||
32 | /*DEBUG( "read_file_into_buffer( %s, %s )\n", *buf, filename ); */ | ||
33 | |||
34 | fp = fopen( filename, "r" ); | ||
35 | |||
36 | if( fp == NULL ) | ||
37 | { | ||
38 | panicf( "failed to open file: %s\n", filename ); | ||
39 | } | ||
40 | |||
41 | while( ( i = getc( fp ) ) != EOF ) | ||
42 | { | ||
43 | /*printf( "%d-'%c'\n", count, i ); */ | ||
44 | count++; | ||
45 | *buf = (char *)realloc( *buf, count * sizeof( char ) ); | ||
46 | /*printf( "%d='%s'\n", *buf, *buf ); */ | ||
47 | (*(buf))[count - 1] = (char)i; | ||
48 | /*printf( "%d='%s'\n", *buf, *buf );*/ | ||
49 | } | ||
50 | |||
51 | /* add null terminator */ | ||
52 | |||
53 | *buf = (char *)realloc( *buf, count * sizeof( char ) ); | ||
54 | (*(buf))[ count ] = '\0'; | ||
55 | |||
56 | /* count -2 because of 0 start and \0 terminator | ||
57 | printf( "read %d bytes: '%s'\n", count - 2, *buf ); */ | ||
58 | } | ||
59 | |||
60 | /* | 26 | /* |
61 | * stub versions of pre-fat sector storage functions | 27 | * stub versions of pre-fat sector storage functions |
62 | */ | 28 | */ |