diff --git a/day4/p2.c b/day4/p2.c index dffbab8..9756d00 100644 --- a/day4/p2.c +++ b/day4/p2.c @@ -6,7 +6,8 @@ #include -#define STACK_SZ 256 +#define STACK_SZ UINT8_MAX+1 +typedef uint8_t stackpointer_t; int32_t parse_number(char *end); @@ -30,7 +31,7 @@ int main(int argc, char **argv) { char *colon_pos = NULL, *pipe_pos = NULL; uint64_t stack[STACK_SZ] = {0}; - uint8_t stack_pos = 0; + stackpointer_t stack_pos = 0; while (getline(&line, &line_length, input) != -1) { colon_pos = strchr(line, ':');