1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2025-06-28 11:55:08 +03:00

initial fix for clang warnings

This commit is contained in:
Tony Chung 2014-07-24 08:55:08 -07:00
parent 16b713b98d
commit a8cc8a7a90
3 changed files with 18 additions and 12 deletions

View File

@ -2406,7 +2406,7 @@ bool MakeLogFileName(LOG *g, char *name, UINT size, char *dir, char *prefix, UIN
if (strcmp(old_datestr, tmp) != 0) if (strcmp(old_datestr, tmp) != 0)
{ {
ret = true; ret = true;
strcpy(old_datestr, tmp); StrCpy(old_datestr, MAX_SIZE, tmp);
} }
snprintf(name, size, "%s%s%s%s%s.log", dir, snprintf(name, size, "%s%s%s%s%s.log", dir,

View File

@ -326,7 +326,7 @@ static wchar_t *WpListener(WEBUI *wu, LIST *params)
WU_CONTEXT *context = WuGetContext(wu->Contexts, sessionkey); WU_CONTEXT *context = WuGetContext(wu->Contexts, sessionkey);
char *cmd = (char*)StrMapSearch(params, "CMD"); char *cmd = (char*)StrMapSearch(params, "CMD");
RPC_LISTENER t; RPC_LISTENER t;
UINT retcode; UINT retcode = ERR_NO_ERROR;
if(context == NULL) if(context == NULL)
{ {

View File

@ -2243,6 +2243,8 @@ void CfgDeleteFolder(FOLDER *f)
// Remove all subfolders // Remove all subfolders
num = LIST_NUM(f->Folders); num = LIST_NUM(f->Folders);
if (num != 0)
{
ff = Malloc(sizeof(FOLDER *) * num); ff = Malloc(sizeof(FOLDER *) * num);
Copy(ff, f->Folders->p, sizeof(FOLDER *) * num); Copy(ff, f->Folders->p, sizeof(FOLDER *) * num);
for (i = 0;i < num;i++) for (i = 0;i < num;i++)
@ -2250,9 +2252,12 @@ void CfgDeleteFolder(FOLDER *f)
CfgDeleteFolder(ff[i]); CfgDeleteFolder(ff[i]);
} }
Free(ff); Free(ff);
}
// Remove all items // Remove all items
num = LIST_NUM(f->Items); num = LIST_NUM(f->Items);
if (num != 0)
{
tt = Malloc(sizeof(ITEM *) * num); tt = Malloc(sizeof(ITEM *) * num);
Copy(tt, f->Items->p, sizeof(ITEM *) * num); Copy(tt, f->Items->p, sizeof(ITEM *) * num);
for (i = 0;i < num;i++) for (i = 0;i < num;i++)
@ -2260,6 +2265,7 @@ void CfgDeleteFolder(FOLDER *f)
CfgDeleteItem(tt[i]); CfgDeleteItem(tt[i]);
} }
Free(tt); Free(tt);
}
// Memory release // Memory release
Free(f->Name); Free(f->Name);