summaryrefslogtreecommitdiff
path: root/iconv
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-06-30 07:33:05 +0000
committerUlrich Drepper <drepper@redhat.com>2004-06-30 07:33:05 +0000
commit606135cf62624432a4b6fac724cad0e23b01202a (patch)
tree611ad0f3ff87f2e42365098966ee9682e19ddd96 /iconv
parent78a9c83742c31dba525254c8bafcfc0b148861cb (diff)
downloadglibc-606135cf62624432a4b6fac724cad0e23b01202a.tar.gz
Use get16/put16 for user given buffer in ucs2/ucs2reverse when unaligned memory access is attempted.
Diffstat (limited to 'iconv')
-rw-r--r--iconv/gconv_simple.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/iconv/gconv_simple.c b/iconv/gconv_simple.c
index 2ed8c523cc..e0d14139ba 100644
--- a/iconv/gconv_simple.c
+++ b/iconv/gconv_simple.c
@@ -1158,7 +1158,7 @@ ucs4le_internal_loop_single (struct __gconv_step *step,
#define LOOPFCT FROM_LOOP
#define BODY \
{ \
- uint16_t u1 = *((const uint16_t *) inptr); \
+ uint16_t u1 = get16 (inptr); \
\
if (__builtin_expect (u1 >= 0xd800 && u1 < 0xe000, 0)) \
{ \
@@ -1216,7 +1216,7 @@ ucs4le_internal_loop_single (struct __gconv_step *step,
} \
else \
{ \
- *((uint16_t *) outptr) = val; \
+ put16 (outptr, val); \
outptr += sizeof (uint16_t); \
inptr += 4; \
} \
@@ -1242,7 +1242,7 @@ ucs4le_internal_loop_single (struct __gconv_step *step,
#define LOOPFCT FROM_LOOP
#define BODY \
{ \
- uint16_t u1 = bswap_16 (*((const uint16_t *) inptr)); \
+ uint16_t u1 = bswap_16 (get16 (inptr)); \
\
if (__builtin_expect (u1 >= 0xd800 && u1 < 0xe000, 0)) \
{ \
@@ -1308,7 +1308,7 @@ ucs4le_internal_loop_single (struct __gconv_step *step,
} \
else \
{ \
- *((uint16_t *) outptr) = bswap_16 (val); \
+ put16 (outptr, bswap_16 (val)); \
outptr += sizeof (uint16_t); \
inptr += 4; \
} \