From: Wayne Davison Date: Tue, 20 Jan 2004 05:35:57 +0000 (+0000) Subject: Use new stringjoin() function. X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/4034cb3f71473271e4c5768c4bb3cdb3c8cf6d61 Use new stringjoin() function. --- diff --git a/sender.c b/sender.c index da51cb4c..8b649a8f 100644 --- a/sender.c +++ b/sender.c @@ -159,15 +159,14 @@ void send_files(struct file_list *flist, int f_out, int f_in) fname[0] = 0; if (file->basedir) { - strlcpy(fname, file->basedir, MAXPATHLEN); - if (strlen(fname) == MAXPATHLEN-1) { + offset = stringjoin(fname, sizeof fname, + file->basedir, "/", NULL); + if (offset >= MAXPATHLEN-1) { io_error |= IOERR_GENERAL; rprintf(FERROR, "send_files failed on long-named directory %s\n", full_fname(fname)); return; } - strlcat(fname, "/", MAXPATHLEN); - offset = strlen(file->basedir)+1; } f_name_to(file, fname + offset, MAXPATHLEN - offset);