diff options
Diffstat (limited to 'stack.c')
| -rw-r--r-- | stack.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1,5 +1,8 @@ #include "stack.h" #include "structs.h" +#include "error.h" +#include "curses.h" /* Required by error.h */ +#include "stdio.h" /* Required by error.h */ PositionStack ps_new(void) { PositionStack ps; @@ -8,7 +11,7 @@ PositionStack ps_new(void) { } int ps_push(PositionStack *ps, Position pos) { - /*TODO: check for stack overflow */ + if (ps->top >= STACK_SIZE) return -1; ps->arr[ps->top] = pos; ps->top += 1; return 0; |
