From: Bruno Haible Date: Sun, 3 May 2026 12:58:41 +0000 (+0200) Subject: readtokens: Use the counted_by attribute. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f29969549a3d26f7aad1b34334f1e5494792c4e;p=thirdparty%2Fgnulib.git readtokens: Use the counted_by attribute. * lib/readtokens.h (struct tokenbuffer): Mark the buffer field as counted_by size. --- diff --git a/ChangeLog b/ChangeLog index f0db5a714a..0d37729605 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2026-05-03 Bruno Haible + + readtokens: Use the counted_by attribute. + * lib/readtokens.h (struct tokenbuffer): Mark the buffer field as + counted_by size. + 2026-05-03 Bruno Haible mbfile: Add comments regarding the counted_by attribute. diff --git a/lib/readtokens.h b/lib/readtokens.h index de83f996fc..a47a96ede7 100644 --- a/lib/readtokens.h +++ b/lib/readtokens.h @@ -33,7 +33,8 @@ extern "C" { struct tokenbuffer { size_t size; - char *buffer; + char *buffer + _GL_ATTRIBUTE_COUNTED_BY (size); }; typedef struct tokenbuffer token_buffer;