mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-11 07:30:57 +02:00
menue.cpp: avoid unterminated strings
Signed-off-by: MarkusVolk <f_l_k@t-online.de>
Origin commit data
------------------
Commit: f37a8c94c1
Author: Markus Volk <f_l_k@t-online.de>
Date: 2020-01-14 (Tue, 14 Jan 2020)
This commit is contained in:
@@ -1850,7 +1850,7 @@ int CMenuOptionNumberChooser::exec(CMenuTarget*)
|
|||||||
int CMenuOptionNumberChooser::paint(bool selected)
|
int CMenuOptionNumberChooser::paint(bool selected)
|
||||||
{
|
{
|
||||||
const char * l_option;
|
const char * l_option;
|
||||||
char option_value[40];
|
char option_value[41];
|
||||||
|
|
||||||
for (size_t i = 0; i < localized.size(); i++)
|
for (size_t i = 0; i < localized.size(); i++)
|
||||||
{
|
{
|
||||||
@@ -1858,7 +1858,7 @@ int CMenuOptionNumberChooser::paint(bool selected)
|
|||||||
{
|
{
|
||||||
if (numberFormatFunction) {
|
if (numberFormatFunction) {
|
||||||
std::string s = numberFormatFunction(*optionValue + display_offset);
|
std::string s = numberFormatFunction(*optionValue + display_offset);
|
||||||
strncpy(option_value, s.c_str(), sizeof(option_value));
|
strncpy(option_value, s.c_str(), sizeof(option_value)-1);
|
||||||
} else
|
} else
|
||||||
sprintf(option_value, numberFormat.c_str(), *optionValue + display_offset);
|
sprintf(option_value, numberFormat.c_str(), *optionValue + display_offset);
|
||||||
l_option = option_value;
|
l_option = option_value;
|
||||||
|
Reference in New Issue
Block a user