]> code.delx.au - gnu-emacs/blobdiff - src/charset.c
* nsfns.m (Fns_do_applescript): Run event loop until script has
[gnu-emacs] / src / charset.c
index c9133c780e8bd03496894f2fc9c8bbbf0caf819d..43be0e9c780167aa829c6db4a0d0de6e639dda24 100644 (file)
@@ -1142,12 +1142,14 @@ usage: (define-charset-internal ...)  */)
             example, the IDs are stuffed into struct
             coding_system.charbuf[i] entries, which are 'int'.  */
          int old_size = charset_table_size;
+         ptrdiff_t new_size = old_size;
          struct charset *new_table =
-           xpalloc (0, &charset_table_size, 1,
+           xpalloc (0, &new_size, 1,
                     min (INT_MAX, MOST_POSITIVE_FIXNUM),
                     sizeof *charset_table);
          memcpy (new_table, charset_table, old_size * sizeof *new_table);
          charset_table = new_table;
+         charset_table_size = new_size;
          /* FIXME: This leaks memory, as the old charset_table becomes
             unreachable.  If the old charset table is charset_table_init
             then this leak is intentional; otherwise, it's unclear.