aports/testing/quota-tools/fix-reallocarray.patch
Milan P. Stanić 08fc3b4ef2 testing/quota-tools: upgrade to 4.06
add missing reallocarray function in musl, taken from musl mailing list
2020-11-11 17:24:27 +00:00

26 lines
574 B
Diff

Author: Milan P. Stanić <mps@arvanta.net>
Date: Wed Nov 11 10:39:23 2020 +0000
add missing reallocarray function in musl, taken from musl mailing list
this fix should be removed when musl add this
--- a/quota.c 2020-09-21 11:33:19.000000000 +0000
+++ b/quota.c 2020-11-11 14:19:19.681307939 +0000
@@ -95,6 +95,16 @@
exit(1);
}
+void *reallocarray(void *ptr, size_t m, size_t n)
+{
+ if (n && m > -1 / n) {
+ errno = ENOMEM;
+ return 0;
+ }
+
+ return realloc(ptr, m * n);
+}
+
static void heading(int type, qid_t id, char *name, char *tag)
{
char *spacehdr;