Return length of 1 for continuation bytes#705
Conversation
A continuation byte is always at least one byte long; returning a length of two makes accidental out of bound reads more likely. Fixes haskell#704
|
Although I don't think there is a solid technical reason for either behaviour, I don't mind merging this, because the change of behaviour in #635 was not intentional. But that assumes that we agree that the changes negate each other and do not require a major version bump in total. |
|
This isn't a breaking change in my opinion. The behaviour for continuation bytes isn't part of the interface, it's an implementation detail that may be subject to change at any time. When using the function correctly, no change can be observed.
I do agree. |
A continuation byte is always at least one byte long; returning a length of two makes accidental out of bound reads more likely. This reverts a change in behaviour in 2.1.3+ due to 1373ce3
Fixes #704