- base_address = atoi_n (buf+12, 5);
-
- length_data_entry = atoi_n (buf+20, 1);
- length_starting = atoi_n (buf+21, 1);
- length_implementation = atoi_n (buf+22, 1);
+ }
+ if (!atoi_n_check(buf+12, 5, &base_address))
+ {
+ if (produce_warnings)
+ wrbuf_printf(wr, "<!-- Base address at offsets 12..16 should hold a number. Assuming 0 -->\n");
+ base_address = 0;
+ }
+ if (!atoi_n_check(buf+20, 1, &length_data_entry))
+ {
+ if (produce_warnings)
+ wrbuf_printf(wr, "<!-- Length data entry at offset 20 should hold a digit. Assuming 4 -->\n");
+ length_data_entry = 4;
+ lead[20] = '4';
+ }
+ if (!atoi_n_check(buf+21, 1, &length_starting))
+ {
+ if (produce_warnings)
+ wrbuf_printf(wr, "<!-- Length starting at offset 21 should hold a digit. Assuming 5 -->\n");
+ length_starting = 5;
+ lead[21] = '5';
+ }
+ if (!atoi_n_check(buf+22, 1, &length_implementation))
+ {
+ if (produce_warnings)
+ wrbuf_printf(wr, "<!-- Length implementation at offset 22 should hold a digit. Assuming 0 -->\n");
+ length_implementation = 0;
+ lead[22] = '0';
+ }