X-Git-Url: https://git.cameronkatri.com/pw-darwin.git/blobdiff_plain/6924c20486d31cd8c84dfbcd4eecf8df045c8d57..c060b30250b3b666ae19dc91192abdfc89250b62:/pw/rm_r.c diff --git a/pw/rm_r.c b/pw/rm_r.c index 3394469..797ca9d 100644 --- a/pw/rm_r.c +++ b/pw/rm_r.c @@ -22,12 +22,16 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id$ */ +#ifndef lint +static const char rcsid[] = + "$FreeBSD$"; +#endif /* not lint */ + #include #include +#include #include #include #include @@ -48,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 */