From 4e423e2bd79422f8c915d56104bd57218a890dbb Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 7 Nov 2013 18:59:42 +0400 Subject: [PATCH] gui/osd_setup.cpp: fix Window size in menu, snprintf take care about 0 at the end --- src/gui/osd_setup.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index bf1deeddc..9760ea225 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -285,7 +285,7 @@ int COsdSetup::exec(CMenuTarget* parent, const std::string &actionKey) if ( msg == CRCInput::RC_ok ) { loop = false; memset(window_size_value, 0, sizeof(window_size_value)); - snprintf(window_size_value, sizeof(window_size_value)-1, "%d / %d", g_settings.window_width, g_settings.window_height); + snprintf(window_size_value, sizeof(window_size_value), "%d / %d", g_settings.window_width, g_settings.window_height); mfWindowSize->setOption(window_size_value); break; } else if ((msg == CRCInput::RC_home) || (msg == CRCInput::RC_timeout)) { @@ -572,7 +572,7 @@ int COsdSetup::showOsdSetup() // window size memset(window_size_value, 0, sizeof(window_size_value)); - snprintf(window_size_value, sizeof(window_size_value)-1, "%d / %d", g_settings.window_width, g_settings.window_height); + snprintf(window_size_value, sizeof(window_size_value), "%d / %d", g_settings.window_width, g_settings.window_height); mfWindowSize = new CMenuForwarder(LOCALE_WINDOW_SIZE, true, window_size_value, this, "window_size", CRCInput::convertDigitToKey(shortcut++)); mfWindowSize->setHint("", LOCALE_MENU_HINT_WINDOW_SIZE); osd_menu->addItem(mfWindowSize);