]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
Use a C99 flexible array for struct tstring. master master-updates
authorNiels Möller <nisse@lysator.liu.se>
Thu, 29 Jan 2026 07:29:23 +0000 (08:29 +0100)
committerNiels Möller <nisse@lysator.liu.se>
Thu, 29 Jan 2026 07:29:23 +0000 (08:29 +0100)
ChangeLog
testsuite/testutils.c
testsuite/testutils.h

index 7a27d756f87a77d297d13f82f09c29247394c309..334c5928f448e6d722e10df0dfcf33d30ac8729c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2026-01-29  Niels Möller  <nisse@lysator.liu.se>
+
+       * testsuite/testutils.h (struct tstring): Change traditional
+       data[1] to C99 flexible array member data[].
+       * testsuite/testutils.c (tstring_alloc): Update allocation
+       accordingly.
+
 2026-01-28  Niels Möller  <nisse@lysator.liu.se>
 
        * arm64: Add alignment at each function prologue.
index 75b4eaecc4f8955e4e5c7cfd50961f88ad5f433d..7b0c9020a428673489c86c06ae195f10908d1c69 100644 (file)
@@ -49,7 +49,7 @@ static struct tstring *tstring_first = NULL;
 struct tstring *
 tstring_alloc (size_t length)
 {
-  struct tstring *s = xalloc(sizeof(struct tstring) + length);
+  struct tstring *s = xalloc(sizeof(struct tstring) + length + 1);
   s->length = length;
   s->next = tstring_first;
   /* NUL-terminate, for convenience. */
index 264811c7fdf5d58f28fc62c198fd07356dc85525..43c9b4116c7173b9aac5998a431cc870a5fe0468 100644 (file)
@@ -45,7 +45,7 @@ xalloc(size_t size);
 struct tstring {
   struct tstring *next;
   size_t length;
-  uint8_t data[1];
+  uint8_t data[];
 };
 
 struct tstring *