Remaining rgagnon source audit improvements (bug #2011)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3430 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2004-07-14 07:44:19 +00:00
parent 872685d088
commit 8ed49644a6
9 changed files with 169 additions and 135 deletions

View File

@@ -211,7 +211,7 @@ static void init_logger_chain(void)
ast_mutex_lock(&loglock);
if ((s = ast_variable_retrieve(cfg, "general", "dateformat"))) {
(void)strncpy(dateformat,s,sizeof(dateformat));
strncpy(dateformat, s, sizeof(dateformat) - 1);
}
var = ast_variable_browse(cfg, "logfiles");
while(var) {
@@ -266,7 +266,7 @@ static void queue_log_init(void)
int reload_logger(int rotate)
{
char old[AST_CONFIG_MAX_PATH];
char old[AST_CONFIG_MAX_PATH] = "";
char new[AST_CONFIG_MAX_PATH];
struct logchannel *f;
FILE *myf;
@@ -307,7 +307,7 @@ int reload_logger(int rotate)
fclose(f->fileptr);
f->fileptr = NULL;
if(rotate) {
strncpy(old, f->filename, sizeof(old));
strncpy(old, f->filename, sizeof(old) - 1);
for(x=0;;x++) {
snprintf(new, sizeof(new), "%s.%d", f->filename, x);