mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-14 08:53:38 +02:00
screensaver.cpp: avoid unterminated strings
Signed-off-by: MarkusVolk <f_l_k@t-online.de>
Origin commit data
------------------
Branch: ni/coolstream
Commit: 4a8ae60f69
Author: Markus Volk <f_l_k@t-online.de>
Date: 2020-01-14 (Tue, 14 Jan 2020)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -281,7 +281,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();
|
||||
@@ -300,7 +300,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