changeset 23453:fa66133ad026

(Ffillarray): Fix previous change.
author Kenichi Handa <handa@m17n.org>
date Wed, 14 Oct 1998 07:17:22 +0000
parents f0077d5425f2
children 8fc72562fce6
files src/fns.c
diffstat 1 files changed, 10 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/fns.c	Wed Oct 14 03:43:20 1998 +0000
+++ b/src/fns.c	Wed Oct 14 07:17:22 1998 +0000
@@ -1794,14 +1794,16 @@
 	  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;
-
-	  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");
-	    }
+	  int i;
+
+	  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];
 	}