diff --git a/src/foptiattr.cpp b/src/foptiattr.cpp index 2880e71c..179eac13 100644 --- a/src/foptiattr.cpp +++ b/src/foptiattr.cpp @@ -849,7 +849,7 @@ short FOptiAttr::vga2ansi (register short color) // 1 1 1 0 | 1 0 1 1 // 1 1 1 1 | 1 1 1 1 - if ( color < 16 ) + if ( ! color < 0 && color < 16 ) { static const short lookup_table[] = { diff --git a/test/term-attributes.cpp b/test/term-attributes.cpp index dc4ffa6f..7a7b2bd3 100644 --- a/test/term-attributes.cpp +++ b/test/term-attributes.cpp @@ -169,7 +169,9 @@ class AttribDemo : public FWidget { } void onWheel (FWheelEvent* ev) { - dynamic_cast(parentWidget())->onWheel(ev); + AttribDlg* p = dynamic_cast(parentWidget()); + if ( p ) + p->onWheel(ev); } }; #pragma pack(pop)