aboutsummaryrefslogtreecommitdiffstats
path: root/common/t-iobuf.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2016-01-12 01:32:20 +0000
committerNIIBE Yutaka <[email protected]>2016-01-12 01:32:20 +0000
commit3f52c7da3940ec06572270d511000dc7fe9c27d2 (patch)
treeef43ad8f5c7f9a1eee402f5444f71114d83ccaae /common/t-iobuf.c
parentgpg: Move documentation from keydb.h to keydb.c and getkey.c. (diff)
downloadgnupg-3f52c7da3940ec06572270d511000dc7fe9c27d2.tar.gz
gnupg-3f52c7da3940ec06572270d511000dc7fe9c27d2.zip
common: Fix iobuf API of filter function for alignment.
* common/iobuf.h (IOBUFCTRL_DESC): Change the call semantics. * common/iobuf.c (iobuf_desc): Add the second argument DESC. (print_chain, iobuf_close, do_open, iobuf_sockopen, iobuf_ioctl) (iobuf_push_filter2, pop_filter, iobuf_write_temp): Change calls of iobuf_desc. (file_filter, file_es_filter, sock_filter, block_filter): Fill the description. * common/t-iobuf.c (every_other_filter, double_filter): Likewise. * g10/armor.c, g10/cipher.c, g10/compress-bz2.c, g10/compress.c, g10/decrypt-data.c, g10/encrypt.c, g10/mdfilter.c, g10/progress.c, g10/textfilter.c: Likewise. -- Newer GCC warns against possible alignment difference of pointers. This change can silence those warnings. Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'common/t-iobuf.c')
-rw-r--r--common/t-iobuf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/common/t-iobuf.c b/common/t-iobuf.c
index 99581b9a8..2835df4d2 100644
--- a/common/t-iobuf.c
+++ b/common/t-iobuf.c
@@ -5,6 +5,7 @@
#include <stdlib.h>
#include "iobuf.h"
+#include "stringhelp.h"
/* Return every other byte. In particular, reads two bytes, returns
the second one. */
@@ -16,7 +17,7 @@ every_other_filter (void *opaque, int control,
if (control == IOBUFCTRL_DESC)
{
- *(char **) buf = "every_other_filter";
+ mem2str (buf, "every_other_filter", *len);
}
if (control == IOBUFCTRL_UNDERFLOW)
{
@@ -52,7 +53,7 @@ double_filter (void *opaque, int control,
if (control == IOBUFCTRL_DESC)
{
- * (char **) buf = "double_filter";
+ mem2str (buf, "double_filter", *len);
}
if (control == IOBUFCTRL_FLUSH)
{