diff --git a/src/fbuttongroup.cpp b/src/fbuttongroup.cpp index b79b1057..ba406d4c 100644 --- a/src/fbuttongroup.cpp +++ b/src/fbuttongroup.cpp @@ -420,8 +420,7 @@ bool FButtonGroup::isRadioButton (const FToggleButton* button) const if ( ! button ) return false; - return bool ( std::strcmp ( button->getClassName() - , C_STR("FRadioButton") ) == 0 ); + return bool( button->getClassName() == "FRadioButton" ); } //---------------------------------------------------------------------- diff --git a/src/fterm.cpp b/src/fterm.cpp index f41cb1e0..fe35a8aa 100644 --- a/src/fterm.cpp +++ b/src/fterm.cpp @@ -991,12 +991,13 @@ void FTerm::setPalette (FColor index, int r, int g, int b) const auto& Ic = TCAP(fc::t_initialize_color); const auto& Ip = TCAP(fc::t_initialize_pair); + bool state{false}; index = FOptiAttr::vga2ansi(index); if ( Ic || Ip ) { - const char* color_str = ""; + const char* color_str{}; int rr = (r * 1001) / 256 , gg = (g * 1001) / 256 @@ -1007,16 +1008,21 @@ void FTerm::setPalette (FColor index, int r, int g, int b) else if ( Ip ) color_str = tparm(Ip, index, 0, 0, 0, rr, gg, bb, 0, 0); - putstring (color_str); + if ( color_str ) + { + putstring (color_str); + state = true; + } } #if defined(__linux__) else { - linux->setPalette(index, r, g, b); + state = linux->setPalette(index, r, g, b); } #endif - std::fflush(stdout); + if ( state ) + std::fflush(stdout); } //----------------------------------------------------------------------