diff options
author | Kenichi Handa <[email protected]> | 1998-10-14 07:17:22 +0000 |
---|---|---|
committer | Kenichi Handa <[email protected]> | 1998-10-14 07:17:22 +0000 |
commit | 95b8aba74b18f5bcfc1410e3cd653b50c37ae301 (patch) | |
tree | bea45e50c3f20bfccaa576b80ea05c7379cd263d /src/fns.c | |
parent | 0cb0ba6c86cbffb5cd2f5df7f96a7ad848fd351c (diff) |
(Ffillarray): Fix previous change.
Diffstat (limited to 'src/fns.c')
-rw-r--r-- | src/fns.c | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -1794,14 +1794,16 @@ ARRAY is a vector, string, char-table, or bool-vector.") int len = CHAR_STRING (charval, workbuf, str); int size_byte = STRING_BYTES (XSTRING (array)); unsigned char *p1 = p, *endp = p + size_byte; - int this_len, i; + int i; - for (i = 0; i < size; i++) - { - this_len = MULTIBYTE_FORM_LENGTH (p1, endp - p1); - if (len != this_len) - error ("Attempt to change byte length of a string"); - } + if (size != size_byte) + while (p1 < endp) + { + int this_len = MULTIBYTE_FORM_LENGTH (p1, endp - p1); + if (len != this_len) + error ("Attempt to change byte length of a string"); + p1 += this_len; + } for (i = 0; i < size_byte; i++) *p++ = str[i % len]; } |