projects
/
pspp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
51a3188
)
Align the temporary buffer.
author
Bruno Haible
<bruno@clisp.org>
Sat, 13 Jan 2007 14:47:41 +0000
(14:47 +0000)
committer
Bruno Haible
<bruno@clisp.org>
Sat, 13 Jan 2007 14:47:41 +0000
(14:47 +0000)
ChangeLog
patch
|
blob
|
history
lib/striconv.c
patch
|
blob
|
history
diff --git
a/ChangeLog
b/ChangeLog
index 8cb85f08c18d1df30db5f5ef84043cfc206ce25b..688ac05694d0c9760a3f5ceae0ab5ec675c15bc4 100644
(file)
--- a/
ChangeLog
+++ b/
ChangeLog
@@
-1,3
+1,7
@@
+2007-01-10 Bruno Haible <bruno@clisp.org>
+
+ * lib/striconv.c (mem_cd_iconv): Align the temporary buffer.
+
2007-01-12 Eric Blake <ebb9@byu.net>
Provide a robust <wchar.h>. Further simplifications are now
2007-01-12 Eric Blake <ebb9@byu.net>
Provide a robust <wchar.h>. Further simplifications are now
diff --git
a/lib/striconv.c
b/lib/striconv.c
index 5326376883e15b364b9b7e7a28fe579c27127bd9..35769bf757761acab609edf54760dbba0c0506b3 100644
(file)
--- a/
lib/striconv.c
+++ b/
lib/striconv.c
@@
-1,5
+1,5
@@
/* Charset conversion.
/* Charset conversion.
- Copyright (C) 2001-200
6
Free Software Foundation, Inc.
+ Copyright (C) 2001-200
7
Free Software Foundation, Inc.
Written by Bruno Haible and Simon Josefsson.
This program is free software; you can redistribute it and/or modify
Written by Bruno Haible and Simon Josefsson.
This program is free software; you can redistribute it and/or modify
@@
-59,7
+59,10
@@
mem_cd_iconv (const char *src, size_t srclen, iconv_t cd,
/* Determine the length we need. */
{
size_t count = 0;
/* Determine the length we need. */
{
size_t count = 0;
- char tmpbuf[tmpbufsize];
+ /* 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;
const char *inptr = src;
size_t insize = srclen;
@@
-107,6
+110,7
@@
mem_cd_iconv (const char *src, size_t srclen, iconv_t cd,
}
# endif
length = count;
}
# endif
length = count;
+# undef tmpbuf
}
if (length == 0)
}
if (length == 0)