From: Andrew Tridgell Date: Sun, 10 May 1998 12:37:26 +0000 (+0000) Subject: changed a couple of places to use strlcpy() X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/e45e0093094fd7e7dd44531bff74188b67869cc4 changed a couple of places to use strlcpy() --- diff --git a/flist.c b/flist.c index 15c56c8e..4c2e984c 100644 --- a/flist.c +++ b/flist.c @@ -872,7 +872,7 @@ char *f_name(struct file_struct *f) if (f->dirname) { sprintf(p, "%s/%s", f->dirname, f->basename); } else { - strcpy(p, f->basename); + strlcpy(p, f->basename, MAXPATHLEN-1); } return p; diff --git a/loadparm.c b/loadparm.c index a66f5206..7fff24f0 100644 --- a/loadparm.c +++ b/loadparm.c @@ -52,7 +52,7 @@ #define strequal(a,b) (strcasecmp(a,b)==0) #define BOOLSTR(b) ((b) ? "Yes" : "No") typedef char pstring[1024]; -#define pstrcpy(a,b) strcpy(a,b) +#define pstrcpy(a,b) strlcpy(a,b,sizeof(pstring)-1) /* the following are used by loadparm for option lists */ typedef enum