Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
changed strlcat() and strlcpy() to have the same semantics as the
[rsync/rsync.git]
/
log.c
diff --git
a/log.c
b/log.c
index
18e1da0
..
6594d45
100644
(file)
--- a/
log.c
+++ b/
log.c
@@
-90,7
+90,7
@@
void log_open(void)
/* recursion can happen with certain fatal conditions */
va_start(ap, format);
/* recursion can happen with certain fatal conditions */
va_start(ap, format);
- len = vslprintf(buf, sizeof(buf)
-1
, format, ap);
+ len = vslprintf(buf, sizeof(buf), format, ap);
va_end(ap);
if (len < 0) exit_cleanup(RERR_MESSAGEIO);
va_end(ap);
if (len < 0) exit_cleanup(RERR_MESSAGEIO);
@@
-188,7
+188,7
@@
static void log_formatted(int fd,
extern int am_sender;
int64 b;
extern int am_sender;
int64 b;
- strlcpy(buf, format, sizeof(buf)
-1
);
+ strlcpy(buf, format, sizeof(buf));
for (s=&buf[0];
s && (p=strchr(s,'%')); ) {
for (s=&buf[0];
s && (p=strchr(s,'%')); ) {
@@
-199,18
+199,18
@@
static void log_formatted(int fd,
case 'h': n = client_name(0); break;
case 'a': n = client_addr(0); break;
case 'l':
case 'h': n = client_name(0); break;
case 'a': n = client_addr(0); break;
case 'l':
- slprintf(buf2,sizeof(buf2)
-1
,"%.0f",
+ slprintf(buf2,sizeof(buf2),"%.0f",
(double)file->length);
n = buf2;
break;
case 'p':
(double)file->length);
n = buf2;
break;
case 'p':
- slprintf(buf2,sizeof(buf2)
-1
,"%d",
+ slprintf(buf2,sizeof(buf2),"%d",
(int)getpid());
n = buf2;
break;
case 'o': n = op; break;
case 'f':
(int)getpid());
n = buf2;
break;
case 'o': n = op; break;
case 'f':
- slprintf(buf2, sizeof(buf2)
-1
, "%s/%s",
+ slprintf(buf2, sizeof(buf2), "%s/%s",
file->basedir?file->basedir:"",
f_name(file));
clean_fname(buf2);
file->basedir?file->basedir:"",
f_name(file));
clean_fname(buf2);
@@
-229,7
+229,7
@@
static void log_formatted(int fd,
b = stats.total_read -
initial_stats->total_read;
}
b = stats.total_read -
initial_stats->total_read;
}
- slprintf(buf2,sizeof(buf2)
-1
,"%.0f", (double)b);
+ slprintf(buf2,sizeof(buf2),"%.0f", (double)b);
n = buf2;
break;
case 'c':
n = buf2;
break;
case 'c':
@@
-240,7
+240,7
@@
static void log_formatted(int fd,
b = stats.total_read -
initial_stats->total_read;
}
b = stats.total_read -
initial_stats->total_read;
}
- slprintf(buf2,sizeof(buf2)
-1
,"%.0f", (double)b);
+ slprintf(buf2,sizeof(buf2),"%.0f", (double)b);
n = buf2;
break;
}
n = buf2;
break;
}