aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'file.c')
-rw-r--r--file.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/file.c b/file.c
index efee0c6..7d227da 100644
--- a/file.c
+++ b/file.c
@@ -2603,20 +2603,19 @@ static void
proc_mchar(struct readbuffer *obuf, int pre_mode,
int width, char **str, Lineprop mode)
{
- int len, slen;
+ size_t len;
check_breakpoint(obuf, pre_mode, *str);
obuf->pos += width;
- len = get_mclen(*str);
- slen = (int)strlen(*str);
- if (len > slen && slen > 0)
- len = slen;
- Strcat_charp_n(obuf->line, *str, len);
+ Strcat_charp_n(obuf->line, *str, get_mclen(*str));
if (width > 0) {
set_prevchar(obuf->prevchar, *str, 1);
if (**str != ' ')
obuf->prev_ctype = mode;
}
+ len = get_mclen(*str);
+ if (len > strlen(*str))
+ len = strlen(*str);
(*str) += len;
obuf->flag |= RB_NFLUSHED;
}