diff options
Diffstat (limited to 'crypto/heimdal/lib/wind/utf8.c')
-rw-r--r-- | crypto/heimdal/lib/wind/utf8.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/crypto/heimdal/lib/wind/utf8.c b/crypto/heimdal/lib/wind/utf8.c index 6907b3c..e1a1eb7 100644 --- a/crypto/heimdal/lib/wind/utf8.c +++ b/crypto/heimdal/lib/wind/utf8.c @@ -204,13 +204,13 @@ wind_ucs4utf8(const uint32_t *in, size_t in_len, char *out, size_t *out_len) switch(len) { case 4: out[3] = (ch | 0x80) & 0xbf; - ch = ch << 6; + ch = ch >> 6; case 3: out[2] = (ch | 0x80) & 0xbf; - ch = ch << 6; + ch = ch >> 6; case 2: out[1] = (ch | 0x80) & 0xbf; - ch = ch << 6; + ch = ch >> 6; case 1: out[0] = ch | first_char[len - 1]; } @@ -346,8 +346,8 @@ wind_ucs2write(const uint16_t *in, size_t in_len, unsigned int *flags, return WIND_ERR_OVERRUN; if ((*flags) & WIND_RW_LE) { - p[0] = (bom >> 8) & 0xff; - p[1] = (bom ) & 0xff; + p[0] = (bom ) & 0xff; + p[1] = (bom >> 8) & 0xff; } else { p[1] = (bom ) & 0xff; p[0] = (bom >> 8) & 0xff; @@ -360,8 +360,8 @@ wind_ucs2write(const uint16_t *in, size_t in_len, unsigned int *flags, if (len < 2) return WIND_ERR_OVERRUN; if ((*flags) & WIND_RW_LE) { - p[0] = (in[0] >> 8) & 0xff; - p[1] = (in[0] ) & 0xff; + p[0] = (in[0] ) & 0xff; + p[1] = (in[0] >> 8) & 0xff; } else { p[1] = (in[0] ) & 0xff; p[0] = (in[0] >> 8) & 0xff; @@ -479,10 +479,10 @@ wind_ucs2utf8(const uint16_t *in, size_t in_len, char *out, size_t *out_len) switch(len) { case 3: out[2] = (ch | 0x80) & 0xbf; - ch = ch << 6; + ch = ch >> 6; case 2: out[1] = (ch | 0x80) & 0xbf; - ch = ch << 6; + ch = ch >> 6; case 1: out[0] = ch | first_char[len - 1]; } |