]> git.cameronkatri.com Git - pw-darwin.git/blobdiff - pw/cpdir.c
backout remove of -q option for pw [user|group] next
[pw-darwin.git] / pw / cpdir.c
index c5534e58d3184b57f68c6ce622e57bf92cfec21b..0fd671b049d5949243d56a095b66edc912afe0d3 100644 (file)
@@ -84,7 +84,7 @@ copymkdir(char const * dir, char const * skel, mode_t mode, uid_t uid, gid_t gid
                                                        if (strcmp(e->d_name, ".") != 0 && strcmp(e->d_name, "..") != 0)
                                                                copymkdir(dst, src, st.st_mode & _DEF_DIRMODE, uid, gid);
                                                                chflags(dst, st.st_flags);      /* propagate flags */
-                                                   } else if (S_ISLNK(st.st_mode) && (len = readlink(src, lnk, sizeof(lnk))) != -1) {
+                                                   } else if (S_ISLNK(st.st_mode) && (len = readlink(src, lnk, sizeof(lnk) - 1)) != -1) {
                                                        lnk[len] = '\0';
                                                        symlink(lnk, dst);
                                                        lchown(dst, uid, gid);