Read and decode the first header */
| 322 | |
| 323 | /* Read and decode the first header */ |
| 324 | static boolean |
| 325 | read_header(FILE *fp, struct BitmapHeader *header) |
| 326 | { |
| 327 | unsigned char buf[14]; |
| 328 | size_t size; |
| 329 | |
| 330 | size = fread(buf, 1, sizeof(buf), fp); |
| 331 | if (size < sizeof(buf)) return FALSE; |
| 332 | |
| 333 | memcpy(header->magic, buf + 0, 2); |
| 334 | header->bmp_size = read_u32(buf + 2); |
| 335 | /* 6 and 8 are 16 bit integers giving the hotspot of a cursor */ |
| 336 | header->img_offset = read_u32(buf + 10); |
| 337 | return TRUE; |
| 338 | } |
| 339 | |
| 340 | /* Read and decode the second header */ |
| 341 | static boolean |
no test coverage detected