summaryrefslogtreecommitdiffstats
path: root/pw/rm_r.c
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2013-06-19 11:36:13 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2013-06-19 11:36:13 +0000
commit92ca6ea990f50c4c8bd3c485bcb54646a590f0ba (patch)
treefd105835d2f614bac3c24fd429fa3bea8f98ef8c /pw/rm_r.c
parent1d39c9328d1f55897e016da0574741cf289c9424 (diff)
parent6e958ef1b49b6a86d2c9a1fd68f98f9e84842aaa (diff)
downloadpw-darwin-92ca6ea990f50c4c8bd3c485bcb54646a590f0ba.tar.gz
pw-darwin-92ca6ea990f50c4c8bd3c485bcb54646a590f0ba.tar.zst
pw-darwin-92ca6ea990f50c4c8bd3c485bcb54646a590f0ba.zip
Merge fresh 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 */