aboutsummaryrefslogtreecommitdiffstats
path: root/logger.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-07-10 22:56:21 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-07-10 22:56:21 +0000
commit9690f518f5b644b670f4e8e047083535c106dafa (patch)
tree922450cc41923990ec190243f4948def77780abf /logger.c
parentcd6f09bb95479166e8a62538b941e9e5daa3394e (diff)
more ast_copy_string conversions
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6073 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'logger.c')
-rwxr-xr-xlogger.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/logger.c b/logger.c
index 403316183..cc55f1e77 100755
--- a/logger.c
+++ b/logger.c
@@ -245,7 +245,7 @@ static struct logchannel *make_logchannel(char *channel, char *components, int l
if(!ast_strlen_zero(hostname)) {
snprintf(chan->filename, sizeof(chan->filename) - 1,"%s.%s", channel, hostname);
} else {
- strncpy(chan->filename, channel, sizeof(chan->filename) - 1);
+ ast_copy_string(chan->filename, channel, sizeof(chan->filename));
}
}
@@ -297,7 +297,7 @@ static void init_logger_chain(void)
if ((s = ast_variable_retrieve(cfg, "general", "appendhostname"))) {
if(ast_true(s)) {
if(gethostname(hostname, sizeof(hostname)-1)) {
- strncpy(hostname, "unknown", sizeof(hostname)-1);
+ ast_copy_string(hostname, "unknown", sizeof(hostname));
ast_log(LOG_WARNING, "What box has no hostname???\n");
}
} else
@@ -305,9 +305,9 @@ static void init_logger_chain(void)
} else
hostname[0] = '\0';
if ((s = ast_variable_retrieve(cfg, "general", "dateformat"))) {
- strncpy(dateformat, s, sizeof(dateformat) - 1);
+ ast_copy_string(dateformat, s, sizeof(dateformat));
} else
- strncpy(dateformat, "%b %e %T", sizeof(dateformat) - 1);
+ ast_copy_string(dateformat, "%b %e %T", sizeof(dateformat));
if ((s = ast_variable_retrieve(cfg, "general", "queue_log"))) {
logfiles.queue_log = ast_true(s);
}
@@ -417,7 +417,7 @@ int reload_logger(int rotate)
fclose(f->fileptr); /* Close file */
f->fileptr = NULL;
if(rotate) {
- strncpy(old, f->filename, sizeof(old) - 1);
+ ast_copy_string(old, f->filename, sizeof(old));
for(x=0;;x++) {
snprintf(new, sizeof(new), "%s.%d", f->filename, x);