]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(set_mode): Parenthesize expressions with bit operations
authorJim Meyering <jim@meyering.net>
Thu, 12 Nov 1992 02:19:02 +0000 (02:19 +0000)
committerJim Meyering <jim@meyering.net>
Thu, 12 Nov 1992 02:19:02 +0000 (02:19 +0000)
to correctly set/reset modes bits.

src/stty.c

index 7e27cac6fc11cc7eda30bcee1134abdc95fda48d..f06a9759c871185cf9d62b50f7223046aed798cb 100644 (file)
@@ -573,11 +573,12 @@ set_mode (info, reversed, mode)
        {
          if (reversed)
            {
-             mode->c_iflag = mode->c_iflag | ICRNL & ~INLCR & ~IGNCR;
-             mode->c_oflag = mode->c_oflag
+             mode->c_iflag = (mode->c_iflag | ICRNL) & ~INLCR & ~IGNCR;
+             mode->c_oflag = (mode->c_oflag
 #ifdef ONLCR
                | ONLCR
 #endif
+                             )
 #ifdef OCRNL
                  & ~OCRNL
 #endif