From: Mattias EngdegÄrd Date: Sat, 3 Jun 2023 10:50:21 +0000 (+0200) Subject: * admin/unidata/emoji-zwj.awk: Avoid sprint buffer overflow X-Git-Tag: emacs-29.0.92~56 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a3459a28e4191b90688fdd0b58d1972af303bc2a;p=emacs.git * admin/unidata/emoji-zwj.awk: Avoid sprint buffer overflow Some AWK implementations have a fixed buffer for sprintf; for mawk the default size is 8192 bytes. Hoist a string concatenation from a sprintf call to avoid running into that limit. See discussion at https://lists.gnu.org/archive/html/emacs-devel/2023-06/msg00090.html . (cherry picked from commit b5f17fe07c6624380ba8d0c7a400a6b89f225209) --- diff --git a/admin/unidata/emoji-zwj.awk b/admin/unidata/emoji-zwj.awk index f13f796bcac..4b648aa675e 100644 --- a/admin/unidata/emoji-zwj.awk +++ b/admin/unidata/emoji-zwj.awk @@ -106,7 +106,7 @@ END { for (elt in ch) { - entries = sprintf("%s\n\"\\N{U+%s}\\N{U+FE0E}\"\n\"\\N{U+%s}\\N{U+FE0F}\"", vec[elt], elt, elt) + entries = vec[elt] sprintf("\n\"\\N{U+%s}\\N{U+FE0E}\"\n\"\\N{U+%s}\\N{U+FE0F}\"", elt, elt) printf("(#x%s .\n,(eval-when-compile (regexp-opt\n'(\n%s\n))))\n", elt, entries) } print "))"