]> git.cameronkatri.com Git - pw-darwin.git/blobdiff - pw/rm_r.c
Convert devd's client socket to type SOCK_SEQPACKET.
[pw-darwin.git] / pw / rm_r.c
index 4ad590bc1aa25e61e5ac89412d34e6701509db04..797ca9de8827b82f2089642a6942819e5a18153c 100644 (file)
--- 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 */