mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-02 18:31:22 +02:00
screensaver.cpp: avoid unterminated strings
Signed-off-by: MarkusVolk <f_l_k@t-online.de>
This commit is contained in:
@@ -255,7 +255,7 @@ bool CScreenSaver::ReadDir()
|
||||
char *dir_name = (char *) d.c_str();
|
||||
struct dirent *dirpointer;
|
||||
DIR *dir;
|
||||
char curr_ext[5];
|
||||
char curr_ext[6];
|
||||
bool ret = false;
|
||||
|
||||
v_bg_files.clear();
|
||||
@@ -274,7 +274,7 @@ bool CScreenSaver::ReadDir()
|
||||
//printf("%d\n",curr_lenght);
|
||||
if(curr_lenght > 4)
|
||||
{
|
||||
strncpy(curr_ext,(*dirpointer).d_name+(curr_lenght-4),5);
|
||||
strncpy(curr_ext,(*dirpointer).d_name+(curr_lenght-4),sizeof(curr_lenght)-1);
|
||||
|
||||
//printf("%s\n",curr_ext);
|
||||
if (strcasecmp(".jpg",curr_ext) && strcasecmp(".png",curr_ext))
|
||||
|
Reference in New Issue
Block a user