From a0b8da9be6615423bdb9ee6f26dbbaadd45ca0ae Mon Sep 17 00:00:00 2001 From: Antoni Sawicki Date: Tue, 7 May 2019 02:20:40 -0700 Subject: fix gcc8 warnings --- fileio.c | 7 +++---- wfm.c | 27 ++++++++++++++------------- wfm.h | 21 +++++++++++---------- 3 files changed, 28 insertions(+), 27 deletions(-) diff --git a/fileio.c b/fileio.c index 122539a..66c726c 100644 --- a/fileio.c +++ b/fileio.c @@ -165,7 +165,7 @@ void edit_save(void) { int size=0; int tmpfd; char *buff; - char tempname[64]={0}; + char tempname[4096]={0}; //FILE *output; FILE *tempf; #ifndef WFMGIT @@ -428,7 +428,7 @@ off_t du(char *pdir) { void re_dir_ui(char *vdir, int level) { struct dirent **direntry; struct stat fileinfo; - char child[sizeof(wp.virt_dirname)]={0}; + char child[sizeof(wp.virt_dirname)+2]={0}; char phy_child[sizeof(wp.phys_dirname)]={0}; char re_phys_dirname[sizeof(wp.phys_dirname)]={0}; int n; @@ -448,8 +448,7 @@ void re_dir_ui(char *vdir, int level) { snprintf(phy_child, sizeof(phy_child), "%s/%s/%s", cfg.homedir, vdir, direntry[e]->d_name); if((direntry[e]->d_name[0]!='.') && (lstat(phy_child, &fileinfo)==0) && S_ISDIR(fileinfo.st_mode)) { - - snprintf(child, sizeof(wp.virt_dirname), "%s/%s", vdir, direntry[e]->d_name); + snprintf(child, sizeof(child), "%s/%s", vdir, direntry[e]->d_name); fprintf(cgiOut, "