Skip to content

Conversation

@benburkhart1
Copy link

This resolves the issue in:

#46

@nabeards
Copy link

nabeards commented Nov 1, 2018

This also appears to resolve my issues in #50 !

@boxerab
Copy link

boxerab commented Mar 26, 2019

LGTM !!

@micolous
Copy link

While it may fix the issue, this change duplicates _utf8_newline, and rolls back increments in the for loop.

I'd propose something much simpler:

size_t utf8_line_length(const utf8_char_t* data)
{
    size_t n, len = 0;

    while (0 != data[len]) {
        if (0 < (n = _utf8_newline(data + len))) {
            return len + n;
        }

        len += utf8_char_length(data + len);
    }

    return len;
}

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

Successfully merging this pull request may close these issues.

4 participants