upstream: https://github.com/mirage/ocaml-mbr
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

mbr: replace catch-all with specific exceptions (merlint E100)

+6 -4
+3 -3
c/MbrPartition.3d
··· 10 10 typedef struct _MbrPartition(mutable WireCtx *ctx) 11 11 { 12 12 UINT8 status {:on-success WireSetU8(ctx, (UINT32) 0, status); return true; }; 13 - UINT8 first_chs[:byte-size 3] {:on-success WireSetBytes(ctx, (UINT32) 1, (UINT32) field_pos); return true; }; 14 - UINT8 type {:on-success WireSetU8(ctx, (UINT32) 2, type); return true; }; 15 - UINT8 last_chs[:byte-size 3] {:on-success WireSetBytes(ctx, (UINT32) 3, (UINT32) field_pos); return true; }; 13 + UINT8 first_chs[:byte-size 3] {:on-success WireSetBytes(ctx, (UINT32) 1, (UINT32) 1); return true; }; 14 + UINT8 type_ {:on-success WireSetU8(ctx, (UINT32) 2, type); return true; }; 15 + UINT8 last_chs[:byte-size 3] {:on-success WireSetBytes(ctx, (UINT32) 3, (UINT32) 5); return true; }; 16 16 UINT32 lba_start {:on-success WireSetU32(ctx, (UINT32) 4, lba_start); return true; }; 17 17 UINT32 sectors {:on-success WireSetU32(ctx, (UINT32) 5, sectors); return true; }; 18 18 } MbrPartition;
+3 -1
lib/mbr.ml
··· 402 402 (* Internal marshal to bytes buffer *) 403 403 let marshal_bytes (buf : bytes) t = 404 404 let parts = t.partitions in 405 - let nth i = try List.nth parts i with _ -> empty_partition in 405 + let nth i = 406 + try List.nth parts i with Failure _ | Invalid_argument _ -> empty_partition 407 + in 406 408 let raw = 407 409 { 408 410 bootstrap1 = String.sub t.bootstrap_code 0 bootstrap_code1_len;