From 3d56716d362d6a827c5f81029ac64c71b56a2f5c Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Thu, 9 Oct 2014 13:43:32 -0500 Subject: Various bugfixes (mostly resource leaks) from Ashwini Sharma's static analysis, plus occasional tweak by me while reviewing them. --- toys/posix/cp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toys/posix/cp.c') 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). -- cgit v1.2.3