diff options
| author | David M. Syzdek <david@syzdek.net> | 2022-06-01 14:21:09 -0800 |
|---|---|---|
| committer | David M. Syzdek <david@syzdek.net> | 2022-06-01 14:21:09 -0800 |
| commit | 379cccf7133f24e936ba9e6e9b680c053a9af476 (patch) | |
| tree | 4ac7072496783e77e4222d9567b968bc07614d6e | |
| parent | f16ca9328e335411f13d760ca8aaf197dce37991 (diff) | |
| download | tinytac-379cccf7133f24e936ba9e6e9b680c053a9af476.tar.gz tinytac-379cccf7133f24e936ba9e6e9b680c053a9af476.tar.bz2 tinytac-379cccf7133f24e936ba9e6e9b680c053a9af476.tar.xz tinytac-379cccf7133f24e936ba9e6e9b680c053a9af476.zip | |
libtinytac: fixing bitwise operators for tinytac_set_option_flag()
| -rw-r--r-- | lib/libtinytac/lmemory.c | 12 |
1 files 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( | |||
| 538 | if (!(flag)) | 538 | if (!(flag)) |
| 539 | return(TTAC_SUCCESS); | 539 | return(TTAC_SUCCESS); |
| 540 | 540 | ||
| 541 | dflt = ((tt)) ? (tinytac_dflt.opts & flag) : (flag & TTAC_DFLT_OPTS); | ||
| 542 | ival = ((invalue)) ? *invalue : dflt; | ||
| 543 | optsp = ((tt)) ? &tt->opts : &tinytac_dflt.opts; | 541 | optsp = ((tt)) ? &tt->opts : &tinytac_dflt.opts; |
| 544 | opts_negp = ((tt)) ? &tt->opts_neg : &tinytac_dflt.opts_neg; | 542 | opts_negp = ((tt)) ? &tt->opts_neg : &tinytac_dflt.opts_neg; |
| 543 | dflt = ((tt)) ? (flag & tinytac_dflt.opts) : (flag & TTAC_DFLT_OPTS); | ||
| 544 | ival = ((invalue)) ? *invalue : dflt; | ||
| 545 | 545 | ||
| 546 | if ((ival)) | 546 | if ((ival)) |
| 547 | { | 547 | { |
| 548 | *optsp |= flag; | 548 | *optsp |= flag; |
| 549 | *opts_negp ^= flag; | 549 | *opts_negp &= ~flag; |
| 550 | } else { | 550 | } else { |
| 551 | *optsp ^= flag; | 551 | *optsp &= ~flag; |
| 552 | *opts_negp |= flag; | 552 | *opts_negp |= flag; |
| 553 | }; | 553 | }; |
| 554 | 554 | ||
| 555 | return(TTAC_SUCCESS); | 555 | return(TTAC_SUCCESS); |
