From: David Lawrence Ramsey Date: Tue, 20 Sep 2005 17:47:27 +0000 (+0000) Subject: *really* fix the previous break_line() problem X-Git-Tag: v1.3.9~22 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=ca37ee67d97444f7abe7a0fd8330cb17ca48bd8d;p=nano.git *really* fix the previous break_line() problem git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3024 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/src/text.c b/src/text.c index 264c8657..173e0935 100644 --- a/src/text.c +++ b/src/text.c @@ -575,10 +575,9 @@ ssize_t break_line(const char *line, ssize_t goal, bool newline) assert(line != NULL); while (*line != '\0' && goal >= 0) { - int pos; + size_t pos = 0; - line_len = parse_mbchar(line, NULL, NULL); - pos = mbwidth(line); + line_len = parse_mbchar(line, NULL, &pos); if (is_blank_mbchar(line) || (newline && *line == '\n')) { blank_loc = cur_loc;