@@ 469,7 469,7 @@ static size_t utf8BytesToCodePoint(const char* buf, size_t len, int* cp) {
*/
size_t linenoiseUtf8NextCharLen(const char* buf, size_t buf_len, size_t pos, size_t *col_len) {
size_t beg = pos;
- int cp;
+ int cp=0;
size_t len = utf8BytesToCodePoint(buf + pos, buf_len - pos, &cp);
if (isCombiningChar(cp)) {
/* NOTREACHED */
@@ 478,7 478,7 @@ size_t linenoiseUtf8NextCharLen(const char* buf, size_t buf_len, size_t pos, siz
if (col_len != NULL) *col_len = isWideChar(cp) ? 2 : 1;
pos += len;
while (pos < buf_len) {
- int cp;
+ int cp=0;
len = utf8BytesToCodePoint(buf + pos, buf_len - pos, &cp);
if (!isCombiningChar(cp)) return pos - beg;
pos += len;
@@ 494,7 494,7 @@ size_t linenoiseUtf8PrevCharLen(const char* buf, size_t buf_len, size_t pos, siz
while (pos > 0) {
size_t len = prevUtf8CharLen(buf, pos);
pos -= len;
- int cp;
+ int cp=0;
utf8BytesToCodePoint(buf + pos, len, &cp);
if (!isCombiningChar(cp)) {
if (col_len != NULL) *col_len = isWideChar(cp) ? 2 : 1;