From 61477ba75dd35655f38b3f280cd20cbe43b46d5a Mon Sep 17 00:00:00 2001 From: Nathan Vance Date: Wed, 29 Apr 2015 21:04:29 -0400 Subject: Fixed bug causing array content to be overwritten --- io.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'io.c') diff --git a/io.c b/io.c index 17c6166..55c1415 100644 --- a/io.c +++ b/io.c @@ -14,6 +14,7 @@ char* cards_specialmessage(int era, int card); int data_getera(); int* data_gethand(int p); int* get_special(int era, int card, int player); +void arraycpy(int *from, int *to, int len); void io_init() { @@ -194,9 +195,9 @@ int print_cards(int x, int y, int *cards, int cursor); int io_printhand(int x, int y, int player, int cursor, int mode) //mode 0 is normal, 1 is discard search { - int *hand; - if(mode) hand = data_getdiscards(); - else hand = data_gethand(player); + int hand[7]; + if(mode) arraycpy(data_getdiscards(), hand, 7); + else arraycpy(data_gethand(player), hand, 7); int i; io_printborder(x, y++, 28); if(mode) { -- cgit