diff --git a/lib/stdlib/qsort.c b/lib/stdlib/qsort.c index 4f3e61cb..24ab9a48 100644 --- a/lib/stdlib/qsort.c +++ b/lib/stdlib/qsort.c @@ -1,6 +1,6 @@ /* -*-comment-start: "//";comment-end:""-*- * GNU Mes --- Maxwell Equations of Software - * Copyright © 2017,2018 Jan (janneke) Nieuwenhuizen + * Copyright © 2017,2018,2019 Jan (janneke) Nieuwenhuizen * * This file is part of GNU Mes. * @@ -18,13 +18,15 @@ * along with GNU Mes. If not, see . */ +#include #include #include void qswap (void *a, void *b, size_t size) { - char *buf[8]; + char buf[128]; + assert (size <= sizeof (buf)); memcpy (buf, a, size); memcpy (a, b, size); memcpy (b, buf, size);