summaryrefslogtreecommitdiff
path: root/log.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-05-07 06:59:37 +0000
committerAndrew Tridgell <tridge@samba.org>2001-05-07 06:59:37 +0000
commit8950ac03f8fd0fb645c7d2374195ea884d091f72 (patch)
tree705b70626cedad8fef430f5046dc73257d95d773 /log.c
parent26ef00bd3c6c66240a4640aa54db1106d8b901fc (diff)
downloadrsync-8950ac03f8fd0fb645c7d2374195ea884d091f72.tar.gz
rsync-8950ac03f8fd0fb645c7d2374195ea884d091f72.tar.bz2
rsync-8950ac03f8fd0fb645c7d2374195ea884d091f72.zip
imported new snprintf.c from samba, got rid of slprintf
Diffstat (limited to 'log.c')
-rw-r--r--log.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/log.c b/log.c
index 3e4d65aa..64e97b91 100644
--- a/log.c
+++ b/log.c
@@ -286,7 +286,7 @@ void rprintf(enum logcode code, const char *format, ...)
int len;
va_start(ap, format);
- len = vslprintf(buf, sizeof(buf), format, ap);
+ len = vsnprintf(buf, sizeof(buf), format, ap);
va_end(ap);
if (len > sizeof(buf)-1) exit_cleanup(RERR_MESSAGEIO);
@@ -311,7 +311,7 @@ void rsyserr(enum logcode code, int errcode, const char *format, ...)
char *sysmsg;
va_start(ap, format);
- len = vslprintf(buf, sizeof(buf), format, ap);
+ len = vsnprintf(buf, sizeof(buf), format, ap);
va_end(ap);
if (len > sizeof(buf)-1) exit_cleanup(RERR_MESSAGEIO);
@@ -392,18 +392,18 @@ static void log_formatted(enum logcode code,
case 'h': if (am_daemon) n = client_name(0); break;
case 'a': if (am_daemon) n = client_addr(0); break;
case 'l':
- slprintf(buf2,sizeof(buf2),"%.0f",
+ snprintf(buf2,sizeof(buf2),"%.0f",
(double)file->length);
n = buf2;
break;
case 'p':
- slprintf(buf2,sizeof(buf2),"%d",
+ snprintf(buf2,sizeof(buf2),"%d",
(int)getpid());
n = buf2;
break;
case 'o': n = op; break;
case 'f':
- slprintf(buf2, sizeof(buf2), "%s/%s",
+ snprintf(buf2, sizeof(buf2), "%s/%s",
file->basedir?file->basedir:"",
f_name(file));
clean_fname(buf2);
@@ -422,7 +422,7 @@ static void log_formatted(enum logcode code,
b = stats.total_read -
initial_stats->total_read;
}
- slprintf(buf2,sizeof(buf2),"%.0f", (double)b);
+ snprintf(buf2,sizeof(buf2),"%.0f", (double)b);
n = buf2;
break;
case 'c':
@@ -433,7 +433,7 @@ static void log_formatted(enum logcode code,
b = stats.total_read -
initial_stats->total_read;
}
- slprintf(buf2,sizeof(buf2),"%.0f", (double)b);
+ snprintf(buf2,sizeof(buf2),"%.0f", (double)b);
n = buf2;
break;
}