comparison src/fns.c @ 23453:fa66133ad026

(Ffillarray): Fix previous change.
author Kenichi Handa <handa@m17n.org>
date Wed, 14 Oct 1998 07:17:22 +0000
parents 982f97638a8e
children 0154f51c56d8
comparison
equal deleted inserted replaced
23452:f0077d5425f2 23453:fa66133ad026
1792 { 1792 {
1793 unsigned char workbuf[4], *str; 1793 unsigned char workbuf[4], *str;
1794 int len = CHAR_STRING (charval, workbuf, str); 1794 int len = CHAR_STRING (charval, workbuf, str);
1795 int size_byte = STRING_BYTES (XSTRING (array)); 1795 int size_byte = STRING_BYTES (XSTRING (array));
1796 unsigned char *p1 = p, *endp = p + size_byte; 1796 unsigned char *p1 = p, *endp = p + size_byte;
1797 int this_len, i; 1797 int i;
1798 1798
1799 for (i = 0; i < size; i++) 1799 if (size != size_byte)
1800 { 1800 while (p1 < endp)
1801 this_len = MULTIBYTE_FORM_LENGTH (p1, endp - p1); 1801 {
1802 if (len != this_len) 1802 int this_len = MULTIBYTE_FORM_LENGTH (p1, endp - p1);
1803 error ("Attempt to change byte length of a string"); 1803 if (len != this_len)
1804 } 1804 error ("Attempt to change byte length of a string");
1805 p1 += this_len;
1806 }
1805 for (i = 0; i < size_byte; i++) 1807 for (i = 0; i < size_byte; i++)
1806 *p++ = str[i % len]; 1808 *p++ = str[i % len];
1807 } 1809 }
1808 else 1810 else
1809 for (index = 0; index < size; index++) 1811 for (index = 0; index < size; index++)