Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

potential bug in utf8 encode #1

Open
jurgen-kluft opened this issue Apr 4, 2016 · 0 comments
Open

potential bug in utf8 encode #1

jurgen-kluft opened this issue Apr 4, 2016 · 0 comments

Comments

@jurgen-kluft
Copy link

If size_t len = write_length(c); returns 0 then the next loop will cause a serious issue:

for (size_t i = len; i != 1; --i) {
// select lower 6 bits
res[i-1] = (c & 0x3f) | 0x80;
c = c >> 6;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant