summaryrefslogtreecommitdiffstats
path: root/pw/rm_r.c
diff options
context:
space:
mode:
authorDavid E. O'Brien <obrien@FreeBSD.org>2013-02-08 16:10:16 +0000
committerDavid E. O'Brien <obrien@FreeBSD.org>2013-02-08 16:10:16 +0000
commit08324d276f48c53cc1af9cfe116a4c930bb77679 (patch)
tree3c2aec6142a66931af5f1da71eae54920375189e /pw/rm_r.c
parent08870ffbc9e2cee84244c234ad5b56ea9aa26fc1 (diff)
parentcbfb9c649bd7eecce96516a347e4bab7c5b2cb52 (diff)
downloadpw-darwin-08324d276f48c53cc1af9cfe116a4c930bb77679.tar.gz
pw-darwin-08324d276f48c53cc1af9cfe116a4c930bb77679.tar.zst
pw-darwin-08324d276f48c53cc1af9cfe116a4c930bb77679.zip
Sync with HEAD.
Diffstat (limited to 'pw/rm_r.c')
-rw-r--r--pw/rm_r.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pw/rm_r.c b/pw/rm_r.c
index 4ad590b..797ca9d 100644
--- a/pw/rm_r.c
+++ b/pw/rm_r.c
@@ -52,7 +52,7 @@ rm_r(char const * dir, uid_t uid)
while ((e = readdir(d)) != NULL) {
if (strcmp(e->d_name, ".") != 0 && strcmp(e->d_name, "..") != 0) {
- sprintf(file, "%s/%s", dir, e->d_name);
+ snprintf(file, sizeof(file), "%s/%s", dir, e->d_name);
if (lstat(file, &st) == 0) { /* Need symlinks, not
* linked file */
if (S_ISDIR(st.st_mode)) /* Directory - recurse */