From 8f72fd8152d62f0fcf5819e73d8ed89663af89c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Teuli=C3=A8re?= Date: Mon, 26 Jan 2009 20:30:41 +0000 Subject: [PATCH] - Always display characters in uppercase on the board (a lowercase character was still possible with a joker, in some rare cases) - Fixed a compilation warning --- qt/board_widget.cpp | 2 +- utils/ncurses.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/qt/board_widget.cpp b/qt/board_widget.cpp index 013e5eb..bd3e4f9 100644 --- a/qt/board_widget.cpp +++ b/qt/board_widget.cpp @@ -123,7 +123,7 @@ void BoardWidget::paintEvent(QPaintEvent *) // Draw the letter if (m_game != NULL && !m_game->getBoard().getTile(row, col).isEmpty()) { - wchar_t chr = m_game->getBoard().getTile(row, col).toChar(); + wchar_t chr = towupper(m_game->getBoard().getTile(row, col).toChar()); if (m_game->getBoard().getCharAttr(row, col) & ATTR_JOKER) painter.setPen(JokerColour); painter.setFont(letterFont); diff --git a/utils/ncurses.cpp b/utils/ncurses.cpp index 208dc60..eae2bcf 100644 --- a/utils/ncurses.cpp +++ b/utils/ncurses.cpp @@ -95,10 +95,10 @@ void Box::printDataLine(int n, int x, const char *fmt, ...) const va_list vl_args; char *buf = NULL; va_start(vl_args, fmt); - vasprintf(&buf, fmt, vl_args); + int res = vasprintf(&buf, fmt, vl_args); va_end(vl_args); - if (buf == NULL) + if (buf == NULL || res == -1) { return; }