From 379cccf7133f24e936ba9e6e9b680c053a9af476 Mon Sep 17 00:00:00 2001 From: "David M. Syzdek" Date: Wed, 1 Jun 2022 14:21:09 -0800 Subject: libtinytac: fixing bitwise operators for tinytac_set_option_flag() --- lib/libtinytac/lmemory.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/libtinytac/lmemory.c b/lib/libtinytac/lmemory.c index 491a5b4..3f86ca9 100644 --- a/lib/libtinytac/lmemory.c +++ b/lib/libtinytac/lmemory.c @@ -538,18 +538,18 @@ tinytac_set_option_flag( if (!(flag)) return(TTAC_SUCCESS); - dflt = ((tt)) ? (tinytac_dflt.opts & flag) : (flag & TTAC_DFLT_OPTS); - ival = ((invalue)) ? *invalue : dflt; optsp = ((tt)) ? &tt->opts : &tinytac_dflt.opts; opts_negp = ((tt)) ? &tt->opts_neg : &tinytac_dflt.opts_neg; + dflt = ((tt)) ? (flag & tinytac_dflt.opts) : (flag & TTAC_DFLT_OPTS); + ival = ((invalue)) ? *invalue : dflt; if ((ival)) { - *optsp |= flag; - *opts_negp ^= flag; + *optsp |= flag; + *opts_negp &= ~flag; } else { - *optsp ^= flag; - *opts_negp |= flag; + *optsp &= ~flag; + *opts_negp |= flag; }; return(TTAC_SUCCESS); -- cgit v1.2.3