summaryrefslogtreecommitdiff
path: root/iconv
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2006-05-11 14:01:43 +0000
committerJakub Jelinek <jakub@redhat.com>2006-05-11 14:01:43 +0000
commit3ec0d26c76d6905501034692d05bddbabae64e76 (patch)
tree191efcdfd934a0369cdef723fe4f650fe2f3dcfc /iconv
parent262cf6b3df91d5bb7cbdcae2390333b21e8008d5 (diff)
Updated to fedora-glibc-20060511T1325cvs/fedora-glibc-2_4_90-7
Diffstat (limited to 'iconv')
-rw-r--r--iconv/iconv_charmap.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/iconv/iconv_charmap.c b/iconv/iconv_charmap.c
index 328121edbe..a54d738120 100644
--- a/iconv/iconv_charmap.c
+++ b/iconv/iconv_charmap.c
@@ -365,19 +365,27 @@ use_to_charmap (const char *from_code, struct charmap_t *to_charmap)
if (outptr != (char *) outbuf)
{
/* We got some output. Good, use it. */
- struct charseq *newp;
+ union
+ {
+ struct charseq seq;
+ struct
+ {
+ const char *name;
+ uint32_t ucs4;
+ int nbytes;
+ unsigned char bytes[outlen];
+ } mem;
+ } new;
outlen = sizeof (outbuf) - outlen;
assert ((char *) outbuf + outlen == outptr);
- newp = (struct charseq *) xmalloc (sizeof (struct charseq)
- + outlen);
- newp->name = out->name;
- newp->ucs4 = out->ucs4;
- newp->nbytes = outlen;
- memcpy (newp->bytes, outbuf, outlen);
+ new.mem.name = out->name;
+ new.mem.ucs4 = out->ucs4;
+ new.mem.nbytes = outlen;
+ memcpy (new.mem.bytes, outbuf, outlen);
- add_bytes (rettbl, newp, out);
+ add_bytes (rettbl, &new.seq, out);
}
/* Clear any possible state left behind. */