fixes strncpy & buf size

Origin commit data
------------------
Branch: ni/coolstream
Commit: 7359504dd7
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2012-08-07 (Tue, 07 Aug 2012)

Origin message was:
------------------
-fixes strncpy & buf size

------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Jacek Jendrzej
2012-08-07 18:51:44 +02:00
parent 35fa9f19d4
commit f748a12ede
15 changed files with 48 additions and 44 deletions

View File

@@ -2884,7 +2884,7 @@ int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info)
if(movie_info != NULL)
{
strncpy(dirItNr, m_dirNames[movie_info->dirItNr].c_str(),BUFFER_SIZE);
strncpy(dirItNr, m_dirNames[movie_info->dirItNr].c_str(),BUFFER_SIZE-1);
snprintf(size,BUFFER_SIZE,"%5llu",movie_info->file.Size>>20);
}
@@ -3448,7 +3448,7 @@ CMenuSelector::CMenuSelector(const char * OptionName, const bool Active , std::s
height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight();
optionValueString = &OptionValue;
optionName = OptionName;
strncpy(buffer,OptionValue.c_str(),BUFFER_MAX);
strncpy(buffer,OptionValue.c_str(),BUFFER_MAX-1);
buffer[BUFFER_MAX-1] = 0;// terminate string
optionValue = buffer;
active = Active;