Hi, For some iconv encodings the buffer needs to be aligned. This fixes an alignment issue on CPUs other than x86.
2007-01-10 Bruno Haible <[EMAIL PROTECTED]> * lib/striconv.c (mem_cd_iconv): Align the temporary buffer. *** gnulib-20070109/lib/striconv.c 2007-01-09 00:14:32.000000000 +0100 --- gnulib-20070109-unistring/lib/striconv.c 2007-01-10 10:05:14.000000000 +0100 *************** *** 1,5 **** /* Charset conversion. ! Copyright (C) 2001-2006 Free Software Foundation, Inc. Written by Bruno Haible and Simon Josefsson. This program is free software; you can redistribute it and/or modify --- 1,5 ---- /* Charset conversion. ! Copyright (C) 2001-2007 Free Software Foundation, Inc. Written by Bruno Haible and Simon Josefsson. This program is free software; you can redistribute it and/or modify *************** *** 59,65 **** /* Determine the length we need. */ { size_t count = 0; ! char tmpbuf[tmpbufsize]; const char *inptr = src; size_t insize = srclen; --- 59,68 ---- /* Determine the length we need. */ { size_t count = 0; ! /* The alignment is needed when converting e.g. to glibc's WCHAR_T or ! libiconv's UCS-4-INTERNAL encoding. */ ! union { unsigned int align; char buf[tmpbufsize]; } tmp; ! # define tmpbuf tmp.buf const char *inptr = src; size_t insize = srclen; *************** *** 107,112 **** --- 110,116 ---- } # endif length = count; + # undef tmpbuf } if (length == 0)