aboutsummaryrefslogtreecommitdiffstats
path: root/src/data.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/data.c')
-rw-r--r--src/data.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/data.c b/src/data.c
index 57d7753e393..3a08a7a8cd3 100644
--- a/src/data.c
+++ b/src/data.c
@@ -2152,17 +2152,19 @@ bool-vector. IDX starts at 0. */)
2152 { 2152 {
2153 EMACS_INT idxval_byte, prev_bytes, new_bytes, nbytes; 2153 EMACS_INT idxval_byte, prev_bytes, new_bytes, nbytes;
2154 unsigned char workbuf[MAX_MULTIBYTE_LENGTH], *p0 = workbuf, *p1; 2154 unsigned char workbuf[MAX_MULTIBYTE_LENGTH], *p0 = workbuf, *p1;
2155 int c;
2155 2156
2156 if (idxval < 0 || idxval >= SCHARS (array)) 2157 if (idxval < 0 || idxval >= SCHARS (array))
2157 args_out_of_range (array, idx); 2158 args_out_of_range (array, idx);
2158 CHECK_CHARACTER (newelt); 2159 CHECK_CHARACTER (newelt);
2160 c = XFASTINT (newelt);
2159 2161
2160 nbytes = SBYTES (array); 2162 nbytes = SBYTES (array);
2161 2163
2162 idxval_byte = string_char_to_byte (array, idxval); 2164 idxval_byte = string_char_to_byte (array, idxval);
2163 p1 = SDATA (array) + idxval_byte; 2165 p1 = SDATA (array) + idxval_byte;
2164 prev_bytes = BYTES_BY_CHAR_HEAD (*p1); 2166 prev_bytes = BYTES_BY_CHAR_HEAD (*p1);
2165 new_bytes = CHAR_STRING (XINT (newelt), p0); 2167 new_bytes = CHAR_STRING (c, p0);
2166 if (prev_bytes != new_bytes) 2168 if (prev_bytes != new_bytes)
2167 { 2169 {
2168 /* We must relocate the string data. */ 2170 /* We must relocate the string data. */