diff --git a/src/driver/vfd.cpp b/src/driver/vfd.cpp index e6bdd5d8a..ceea0b869 100644 --- a/src/driver/vfd.cpp +++ b/src/driver/vfd.cpp @@ -703,13 +703,17 @@ void CVFD::ShowIcon(fp_icon icon, bool show) void CVFD::ShowText(const char * str) { char flags[2] = { FP_FLAG_ALIGN_LEFT, 0 }; + if (! str) { + printf("CVFD::ShowText: str is NULL!\n"); + return; + } - if (g_settings.lcd_scroll) + if (g_settings.lcd_scroll && (strlen(str) > g_info.hw_caps->display_xres)) flags[0] |= FP_FLAG_SCROLL_ON | FP_FLAG_SCROLL_SIO | FP_FLAG_SCROLL_DELAY; std::string txt = std::string(flags) + str; txt = trim(txt); - printf("CVFD::ShowText: [%s]\n", txt.c_str() + 1); + printf("CVFD::ShowText: [0x%02x][%s]\n", flags[0], txt.c_str() + 1); size_t len = txt.length(); if (txt == text || len > 255)