Commit 10408c0d authored by Caleb C. Sander's avatar Caleb C. Sander
Browse files

Make index bounds consistent with spec

parent e2c43114
No related merge requests found
Showing with 3 additions and 3 deletions
+3 -3
......@@ -7,10 +7,10 @@
#include "stage2.h"
const size_t MIN_CHOICE = 1;
const size_t MAX_CHOICE = 256;
const size_t MAX_CHOICE = UINT8_MAX;
static inline page_t *init_pages(void) {
return calloc(MAX_CHOICE, sizeof(page_t));
return calloc(MAX_CHOICE + 1, sizeof(page_t));
}
static inline void flush_all_pages(page_t *pages) {
......
......@@ -10,7 +10,7 @@ const size_t MAX_CHOICE = 'Z' + 1;
const size_t SECRET_LENGTH = 5;
static inline page_t *init_pages(void) {
return calloc(MAX_CHOICE, sizeof(page_t));
return calloc(MAX_CHOICE + 1, sizeof(page_t));
}
static inline void flush_all_pages(page_t *pages) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment