From 6b84ecbf312d98ac8cce9fe5facdc815bc742fa1 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 2 Jan 2017 13:29:18 +0100 Subject: Replace use of variable-length-arrays. * common/t-iobuf.c (main): Replace variable-length-array. * g10/gpgcompose.c (mksubpkt_callback): Ditto. (encrypted): Ditto. * g10/t-stutter.c (log_hexdump): Ditto. (oracle_test): Ditto. * g10/tofu.c (get_policy): Ditto. Use "%zu" for size_t. * scd/app-openpgp.c (ecc_writekey): Replace variable-length-array. Check for zero length OID_LEN. Signed-off-by: Werner Koch --- common/t-iobuf.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'common/t-iobuf.c') diff --git a/common/t-iobuf.c b/common/t-iobuf.c index 0e6f508a5..bdeab99a4 100644 --- a/common/t-iobuf.c +++ b/common/t-iobuf.c @@ -362,10 +362,12 @@ main (int argc, char *argv[]) { iobuf_t iobuf; int rc; - char *content = "0123456789"; + char content[] = "0123456789"; int n; int c; - char buffer[strlen (content)]; + char buffer[10]; + + assert (sizeof buffer == sizeof content - 1); iobuf = iobuf_temp_with_content (content, strlen (content)); assert (iobuf); -- cgit v1.2.3