aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/coding.c b/src/coding.c
index d4c468cfbbf..5e7a676aecd 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -7273,15 +7273,12 @@ produce_charset (struct coding_system *coding, int *charbuf, ptrdiff_t pos)
7273 7273
7274#define ALLOC_CONVERSION_WORK_AREA(coding, size) \ 7274#define ALLOC_CONVERSION_WORK_AREA(coding, size) \
7275 do { \ 7275 do { \
7276 int units = (size) + MAX_CHARBUF_EXTRA_SIZE; \ 7276 ptrdiff_t units = min ((size) + MAX_CHARBUF_EXTRA_SIZE, \
7277 \ 7277 MAX_CHARBUF_SIZE); \
7278 if (units > MAX_CHARBUF_SIZE) \ 7278 coding->charbuf = SAFE_ALLOCA (units * sizeof (int)); \
7279 units = MAX_CHARBUF_SIZE; \ 7279 coding->charbuf_size = units; \
7280 coding->charbuf = SAFE_ALLOCA ((units) * sizeof (int)); \
7281 coding->charbuf_size = (units); \
7282 } while (0) 7280 } while (0)
7283 7281
7284
7285static void 7282static void
7286produce_annotation (struct coding_system *coding, ptrdiff_t pos) 7283produce_annotation (struct coding_system *coding, ptrdiff_t pos)
7287{ 7284{