aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/fns.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/fns.c b/src/fns.c
index 702ecbd7c63..32d96fbc94e 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -2169,13 +2169,12 @@ ARRAY is a vector, string, char-table, or bool-vector. */)
2169 unsigned char str[MAX_MULTIBYTE_LENGTH]; 2169 unsigned char str[MAX_MULTIBYTE_LENGTH];
2170 int len = CHAR_STRING (charval, str); 2170 int len = CHAR_STRING (charval, str);
2171 EMACS_INT size_byte = SBYTES (array); 2171 EMACS_INT size_byte = SBYTES (array);
2172 EMACS_INT i;
2173 2172
2174 if (INT_MULTIPLY_OVERFLOW (SCHARS (array), len) 2173 if (INT_MULTIPLY_OVERFLOW (SCHARS (array), len)
2175 || SCHARS (array) * len != size_byte) 2174 || SCHARS (array) * len != size_byte)
2176 error ("Attempt to change byte length of a string"); 2175 error ("Attempt to change byte length of a string");
2177 for (i = 0; i < size_byte; i++) 2176 for (idx = 0; idx < size_byte; idx++)
2178 *p++ = str[i % len]; 2177 *p++ = str[idx % len];
2179 } 2178 }
2180 else 2179 else
2181 for (idx = 0; idx < size; idx++) 2180 for (idx = 0; idx < size; idx++)