Revision 295abf36
b/block-vvfat.c | ||
---|---|---|
93 | 93 |
|
94 | 94 |
/* does not automatically grow */ |
95 | 95 |
static inline void* array_get(array_t* array,unsigned int index) { |
96 |
assert(index >= 0); |
|
97 | 96 |
assert(index < array->next); |
98 | 97 |
return array->pointer + index * array->item_size; |
99 | 98 |
} |
... | ... | |
195 | 194 |
static int array_index(array_t* array, void* pointer) |
196 | 195 |
{ |
197 | 196 |
size_t offset = (char*)pointer - array->pointer; |
198 |
assert(offset >= 0); |
|
199 | 197 |
assert((offset % array->item_size) == 0); |
200 | 198 |
assert(offset/array->item_size < array->next); |
201 | 199 |
return offset/array->item_size; |
... | ... | |
2238 | 2236 |
|
2239 | 2237 |
assert((size - offset == 0 && fat_eof(s, c)) || |
2240 | 2238 |
(size > offset && c >=2 && !fat_eof(s, c))); |
2241 |
assert(size >= 0); |
|
2242 | 2239 |
|
2243 | 2240 |
ret = vvfat_read(s->bs, cluster2sector(s, c), |
2244 | 2241 |
(uint8_t*)cluster, (rest_size + 0x1ff) / 0x200); |
Also available in: Unified diff