diff 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
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];
 	}