summaryrefslogtreecommitdiff
path: root/src/insdel.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/insdel.c')
-rw-r--r--src/insdel.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/insdel.c b/src/insdel.c
index dfa1cc311ca..c37b0710783 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -382,10 +382,10 @@ count_bytes (ptrdiff_t pos, ptrdiff_t bytepos, ptrdiff_t endpos)
if (pos <= endpos)
for ( ; pos < endpos; pos++)
- INC_POS (bytepos);
+ bytepos += next_char_len (bytepos);
else
for ( ; pos > endpos; pos--)
- DEC_POS (bytepos);
+ bytepos -= prev_char_len (bytepos);
return bytepos;
}
@@ -626,8 +626,7 @@ copy_text (const unsigned char *from_addr, unsigned char *to_addr,
while (bytes_left > 0)
{
- int thislen, c;
- c = STRING_CHAR_AND_LENGTH (from_addr, thislen);
+ int thislen, c = string_char_and_length (from_addr, &thislen);
if (! ASCII_CHAR_P (c))
c &= 0xFF;
*to_addr++ = c;