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
use strlcat() strlcpy() and slprintf() whenever possible to avoid any
[rsync/rsync.git]
/
flist.c
diff --git
a/flist.c
b/flist.c
index
d7da6e8
..
bc1ceba
100644
(file)
--- a/
flist.c
+++ b/
flist.c
@@
-521,7
+521,7
@@
static void send_directory(int f,struct file_list *flist,char *dir)
closedir(d);
return;
}
closedir(d);
return;
}
- str
cat(fname,"/"
);
+ str
lcat(fname,"/", MAXPATHLEN-1
);
l++;
}
p = fname + strlen(fname);
l++;
}
p = fname + strlen(fname);
@@
-585,7
+585,7
@@
struct file_list *send_file_list(int f,int argc,char *argv[])
l = strlen(fname);
if (l != 1 && fname[l-1] == '/') {
l = strlen(fname);
if (l != 1 && fname[l-1] == '/') {
- str
cat(fname,"."
);
+ str
lcat(fname,".",MAXPATHLEN-1
);
}
if (link_stat(fname,&st) != 0) {
}
if (link_stat(fname,&st) != 0) {
@@
-878,7
+878,7
@@
char *f_name(struct file_struct *f)
n = (n+1)%10;
if (f->dirname) {
n = (n+1)%10;
if (f->dirname) {
- s
printf(p
, "%s/%s", f->dirname, f->basename);
+ s
lprintf(p, MAXPATHLEN-1
, "%s/%s", f->dirname, f->basename);
} else {
strlcpy(p, f->basename, MAXPATHLEN-1);
}
} else {
strlcpy(p, f->basename, MAXPATHLEN-1);
}