Commit b0de663
committed
pico w: setsockopt: Fix sense of disable vs enable
memcmp() returns -1, 0 or 1 to denote the relative ordering of the two
buffers. So, the computation would actually set `enable = 0`
in the case where `value` had the same bits set as "one" and `enable = 1`
in the case where `value` had any other bits.
By changing the compared buffer to be `zero`, `enable` gets a true value
whenever the value is NOT exactly 0 (e.g., it's 1, 7, -1, ...),
correcting the sense of enable vs disable.
Thanks to @anecdata for testing and finding this problem, which previously
would have affected the nodelay flag as well.1 parent a6b1292 commit b0de663
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1184 | 1184 | | |
1185 | 1185 | | |
1186 | 1186 | | |
1187 | | - | |
1188 | | - | |
| 1187 | + | |
| 1188 | + | |
1189 | 1189 | | |
1190 | 1190 | | |
1191 | 1191 | | |
| |||
0 commit comments