# HG changeset patch # User Chris Cannam # Date 1400866901 -3600 # Fri May 23 18:41:41 2014 +0100 # Branch wmx # Node ID e599fef17624986497e6b684c99083bbf7b0e3f3 # Parent 295eae7831d8ffc334eb2a106a632710c30765f3 Fix operator precedence problem reported by dcb314. The first definition of STRLEN_MITEMS lacked outer parentheses, so was bound in an unexpected way when used in an arithmetic expression. diff --git a/Menu.C b/Menu.C --- a/Menu.C +++ b/Menu.C @@ -24,10 +24,10 @@ Window *Menu::m_window; #if MENU_ENTRY_MAXLENGTH > 0 -#define STRLEN_MITEMS(i) (strlen(m_items[(i)]) > MENU_ENTRY_MAXLENGTH) ? \ - MENU_ENTRY_MAXLENGTH : strlen(m_items[(i)]) +#define STRLEN_MITEMS(i) ((strlen(m_items[(i)]) > MENU_ENTRY_MAXLENGTH) ? \ + MENU_ENTRY_MAXLENGTH : strlen(m_items[(i)])) #else -#define STRLEN_MITEMS(i) strlen(m_items[(i)]) +#define STRLEN_MITEMS(i) (strlen(m_items[(i)])) #endif