aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/xfns.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/xfns.c b/src/xfns.c
index b393578d52c..7f75550c184 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -2378,12 +2378,14 @@ x_encode_text (string, coding_system, selectionp, text_bytes, stringp)
2378 coding.mode |= (CODING_MODE_SAFE_ENCODING | CODING_MODE_LAST_BLOCK); 2378 coding.mode |= (CODING_MODE_SAFE_ENCODING | CODING_MODE_LAST_BLOCK);
2379 /* We suppress producing escape sequences for composition. */ 2379 /* We suppress producing escape sequences for composition. */
2380 coding.common_flags &= ~CODING_ANNOTATION_MASK; 2380 coding.common_flags &= ~CODING_ANNOTATION_MASK;
2381 coding.dst_bytes = XSTRING (string)->size * 2;
2382 coding.destination = (unsigned char *) xmalloc (coding.dst_bytes);
2381 encode_coding_object (&coding, string, 0, 0, 2383 encode_coding_object (&coding, string, 0, 0,
2382 XSTRING (string)->size, 2384 XSTRING (string)->size,
2383 STRING_BYTES (XSTRING (string)), Qt); 2385 STRING_BYTES (XSTRING (string)), Qnil);
2384 *text_bytes = coding.produced; 2386 *text_bytes = coding.produced;
2385 *stringp = (result == 1 || !EQ (coding_system, Qcompound_text)); 2387 *stringp = (result == 1 || !EQ (coding_system, Qcompound_text));
2386 return XSTRING (coding.dst_object)->data; 2388 return coding.destination;
2387} 2389}
2388 2390
2389 2391