A little refactoring for day 5.
This commit is contained in:
parent
443576621d
commit
83944d8d4c
@ -3,7 +3,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
|
||||
int64_t parse_number(char *end);
|
||||
|
@ -3,7 +3,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
|
||||
uint64_t parse_number(char *end);
|
||||
@ -63,8 +62,7 @@ int main(int argc, char **argv) {
|
||||
} else if (line[0]>>4 != 0x3)
|
||||
continue;
|
||||
|
||||
map_lengths[maps_cur]++;
|
||||
maps[maps_cur] = (map_t *) realloc(maps[maps_cur], map_lengths[maps_cur] * sizeof(map_t));
|
||||
maps[maps_cur] = (map_t *) realloc(maps[maps_cur], ++map_lengths[maps_cur] * sizeof(map_t));
|
||||
|
||||
map_t new_range_map = {0};
|
||||
sscanf(line, "%lu %lu %lu\n", &new_range_map.dst, &new_range_map.src, &new_range_map.rng);
|
||||
|
Loading…
Reference in New Issue
Block a user