You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, this is incorrect. It technically works under most circumstances, which is why it's gone unnoticed, however, this returns the wrong length for non-UTF-8 strings. Looking at the corrected macro makes it clear why:
Instead of simply subtracting the teminating null after calculating the array length, the current definition overthinks things and instead subtracts the size of the characters in bytes.
While this admittedly isn't a very critical bug, it's still a silly one, it stil actually cropped up in my environment somehow, and it is a one-line fix.
The text was updated successfully, but these errors were encountered:
For now, should I drop the version I'm using here? All I really did was change all the chars to wchar_ts along with a few other minor tweaks to get it working, but it does work.
CLAY__STRING_LENGTH
is defined as:However, this is incorrect. It technically works under most circumstances, which is why it's gone unnoticed, however, this returns the wrong length for non-UTF-8 strings. Looking at the corrected macro makes it clear why:
Instead of simply subtracting the teminating null after calculating the array length, the current definition overthinks things and instead subtracts the size of the characters in bytes.
While this admittedly isn't a very critical bug, it's still a silly one, it stil actually cropped up in my environment somehow, and it is a one-line fix.
The text was updated successfully, but these errors were encountered: