From 78670e9650334261d698aeccab36840409200d20 Mon Sep 17 00:00:00 2001 From: Eric House Date: Sat, 29 Dec 2012 07:48:31 -0800 Subject: [PATCH] fix bug: include wordlist name in bad word info passed into util function --- xwords4/common/board.c | 4 +++- xwords4/common/util.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/xwords4/common/board.c b/xwords4/common/board.c index b9fe9dcf6..e365ea6c3 100644 --- a/xwords4/common/board.c +++ b/xwords4/common/board.c @@ -743,12 +743,14 @@ warnBadWords( const XP_UCHAR* word, XP_Bool isLegal, { XP_Bool ok = XP_TRUE; if ( !isLegal ) { - BadWordInfo bwi; + BadWordInfo bwi = {0}; BoardCtxt* board = (BoardCtxt*)closure; XP_S16 turn = server_getCurrentTurn( board->server ); bwi.nWords = 1; bwi.words[0] = word; + bwi.dictName = + dict_getShortName( model_getPlayerDict( board->model, turn ) ); ok = !board->badWordRejected && util_warnIllegalWord( board->util, &bwi, turn, XP_FALSE ); diff --git a/xwords4/common/util.h b/xwords4/common/util.h index 29c64fd3d..f9866042b 100644 --- a/xwords4/common/util.h +++ b/xwords4/common/util.h @@ -82,7 +82,7 @@ typedef struct PickInfo { typedef struct BadWordInfo { XP_U16 nWords; - XP_UCHAR* dictName; + const XP_UCHAR* dictName; const XP_UCHAR* words[MAX_TRAY_TILES+1]; /* can form in both directions */ } BadWordInfo;