diff options
author | eug-vs <eugene@eug-vs.xyz> | 2022-03-31 21:16:42 +0300 |
---|---|---|
committer | eug-vs <eugene@eug-vs.xyz> | 2022-03-31 21:18:03 +0300 |
commit | c5418464d57de2b71a91ddfbb4c42df25a743da9 (patch) | |
tree | 1420842121ef8cadfb75908224ae5afa5fba5a8b /src/main.c | |
parent | be2885fc3eb77ec33c5afe10a741ff23a21b0b5d (diff) | |
download | carcassonne-engine-c-c5418464d57de2b71a91ddfbb4c42df25a743da9.tar.gz |
fix: cap max amount of input characters
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1,4 +1,5 @@ #include <stdio.h> +#include <stdlib.h> #include <curses.h> #include "board.h" @@ -47,7 +48,7 @@ int main() { initialize_board(board); - Tile tile = { "FRCR", 'R' }; + Tile tile = { "FRCR", 'R', 0 }; place_tile(tile, translate_coordinate(24), board, 1); /* main loop */ @@ -69,7 +70,7 @@ int main() { box(input_box, 0, 0); mvwaddstr(input_box, 0, 0, "Enter tile:"); wrefresh(input_box); - wgetstr(input_win, tile.edges); + wgetnstr(input_win, tile.edges, 5); wclear(input_win); if (tile.edges[0] == 'q') break; |