summaryrefslogtreecommitdiffstats
path: root/common/t-iobuf.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2017-01-02 13:29:18 +0100
committerWerner Koch <wk@gnupg.org>2017-01-02 13:29:18 +0100
commit6b84ecbf312d98ac8cce9fe5facdc815bc742fa1 (patch)
treea607006cafbc14a6d52a054ee1a2b5d77f435d5c /common/t-iobuf.c
parentbuild: Enable gcc warnings to detect non-portable code. (diff)
downloadgnupg2-6b84ecbf312d98ac8cce9fe5facdc815bc742fa1.tar.xz
gnupg2-6b84ecbf312d98ac8cce9fe5facdc815bc742fa1.zip
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 <wk@gnupg.org>
Diffstat (limited to 'common/t-iobuf.c')
-rw-r--r--common/t-iobuf.c6
1 files changed, 4 insertions, 2 deletions
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);