]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
flex: Drop patch to use reallocarray
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 1 Dec 2022 08:05:44 +0000 (08:05 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 1 Dec 2022 08:05:44 +0000 (08:05 +0000)
I don't quite know why any more.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
flex/patches/flex-2.6.4-build-fix-reallocarray.patch [deleted file]

diff --git a/flex/patches/flex-2.6.4-build-fix-reallocarray.patch b/flex/patches/flex-2.6.4-build-fix-reallocarray.patch
deleted file mode 100644 (file)
index 186e4d7..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-From 23797fd0b0908dd2c5775e6135728c7384f4e952 Mon Sep 17 00:00:00 2001
-From: Thomas Klausner <wiz@NetBSD.org>
-Date: Fri, 19 May 2017 10:22:44 +0200
-Subject: [PATCH] Use reallocarr() when available.
-
-Fixes https://github.com/westes/flex/issues/219
----
- configure.ac |  1 +
- src/misc.c   | 16 ++++++++++++++--
- 2 files changed, 15 insertions(+), 2 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 55e774b0..d0f3b7da 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -166,6 +166,7 @@ strtol dnl
- AC_CHECK_FUNCS([dnl
- pow dnl           Used only by "examples/manual/expr"
- setlocale dnl     Needed only if NLS is enabled
-+reallocarr dnl    NetBSD function. Use reallocarray if not available.
- reallocarray dnl  OpenBSD function. We have replacement if not available.
- ])
-diff --git a/src/misc.c b/src/misc.c
-index ef27833c..39483ea8 100644
---- a/src/misc.c
-+++ b/src/misc.c
-@@ -142,7 +142,14 @@ void add_action (const char *new_text)
- void   *allocate_array (int size, size_t element_size)
- {
-       void *mem;
--#if HAVE_REALLOCARRAY
-+#if HAVE_REALLOCARR
-+      mem = NULL;
-+      if (reallocarr(&mem, (size_t) size, element_size))
-+              flexfatal (_
-+                         ("memory allocation failed in allocate_array()"));
-+
-+      return mem;
-+#elif HAVE_REALLOCARRAY
-       /* reallocarray has built-in overflow detection */
-       mem = reallocarray(NULL, (size_t) size, element_size);
- #else
-@@ -659,7 +666,12 @@ char   *readable_form (int c)
- void   *reallocate_array (void *array, int size, size_t element_size)
- {
-       void *new_array;
--#if HAVE_REALLOCARRAY
-+#if HAVE_REALLOCARR
-+      if (reallocarr(&array, (size_t) size, element_size))
-+              flexfatal (_("attempt to increase array size failed"));
-+
-+      return array;
-+#elif HAVE_REALLOCARRAY
-       /* reallocarray has built-in overflow detection */
-       new_array = reallocarray(array, (size_t) size, element_size);
- #else