From a037e838e15c9a698f1634398e0fe2726398d575 Mon Sep 17 00:00:00 2001 From: Pádraig Brady Date: Wed, 23 Sep 2009 10:10:51 +0100 Subject: maint: Use logical rather than bitwise operators on bools This is because bitwise operators are: - confusing and inconsistent in a boolean context - non short circuiting - brittle in C89 where bool can be an int (so > 1) --- src/chmod.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/chmod.c') diff --git a/src/chmod.c b/src/chmod.c index e6f2b0b64..da350032f 100644 --- a/src/chmod.c +++ b/src/chmod.c @@ -279,7 +279,7 @@ process_file (FTS *fts, FTSENT *ent) } } - if (chmod_succeeded & diagnose_surprises) + if (chmod_succeeded && diagnose_surprises) { mode_t naively_expected_mode = mode_adjust (old_mode, S_ISDIR (old_mode) != 0, 0, change, NULL); @@ -523,7 +523,7 @@ main (int argc, char **argv) umask_value = umask (0); } - if (recurse & preserve_root) + if (recurse && preserve_root) { static struct dev_ino dev_ino_buf; root_dev_ino = get_root_dev_ino (&dev_ino_buf); -- cgit v1.2.3-54-g00ecf