aboutsummaryrefslogtreecommitdiff
path: root/toys/posix/cp.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2014-10-09 13:43:32 -0500
committerRob Landley <rob@landley.net>2014-10-09 13:43:32 -0500
commit3d56716d362d6a827c5f81029ac64c71b56a2f5c (patch)
tree93377ffa6621214916c82b0985483e4d13822336 /toys/posix/cp.c
parent7196d758a0728bd43451f869eb85528b6cd20bea (diff)
downloadtoybox-3d56716d362d6a827c5f81029ac64c71b56a2f5c.tar.gz
Various bugfixes (mostly resource leaks) from Ashwini Sharma's static analysis, plus occasional tweak by me while reviewing them.
Diffstat (limited to 'toys/posix/cp.c')
-rw-r--r--toys/posix/cp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/posix/cp.c b/toys/posix/cp.c
index d73b7229..fdb7c8ae 100644
--- a/toys/posix/cp.c
+++ b/toys/posix/cp.c
@@ -119,7 +119,7 @@ int cp_node(struct dirtree *try)
} else {
// -d is only the same as -r for symlinks, not for directories
- if (S_ISLNK(try->st.st_mode) & (flags & FLAG_d)) flags |= FLAG_r;
+ if (S_ISLNK(try->st.st_mode) && (flags & FLAG_d)) flags |= FLAG_r;
// Detect recursive copies via repeated top node (cp -R .. .) or
// identical source/target (fun with hardlinks).