From 5b546faa67544af395d6407553762b37e9711157 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 10 Nov 2017 15:06:42 -0500 Subject: add iconv framework for decoding stateful encodings assuming pointers obtained from malloc have some nonzero alignment, repurpose the low bit of iconv_t as an indicator that the descriptor is a stateless value representing the source and destination character encodings. --- src/locale/iconv_close.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/locale/iconv_close.c') diff --git a/src/locale/iconv_close.c b/src/locale/iconv_close.c index fac681cc..28b29565 100644 --- a/src/locale/iconv_close.c +++ b/src/locale/iconv_close.c @@ -1,6 +1,8 @@ #include +#include int iconv_close(iconv_t cd) { + if (!((size_t)cd & 1)) free((void *)cd); return 0; } -- cgit v1.2.1