diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-10-24 12:19:57 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-10-24 12:20:01 +0200 |
commit | 8167accbcdc2d4d757883fa8924689f359100036 (patch) | |
tree | 2c130786434462d810904df8bbe1bc1f59e2640c | |
parent | m (diff) | |
download | mds-8167accbcdc2d4d757883fa8924689f359100036.tar.gz mds-8167accbcdc2d4d757883fa8924689f359100036.tar.bz2 mds-8167accbcdc2d4d757883fa8924689f359100036.tar.xz |
whoops
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r-- | src/mds-kbdc/string.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mds-kbdc/string.c b/src/mds-kbdc/string.c index 82797f3..ac3ef4b 100644 --- a/src/mds-kbdc/string.c +++ b/src/mds-kbdc/string.c @@ -102,9 +102,9 @@ char* string_encode(const char32_t* restrict string) for (i = j = 0; i < n; i++) { #define _c(s) rc[j++] = (char)(((c >> (s)) & 0x3F) | 0x80) -#define _t(s) t < (char32_t)(1L << s) +#define _t(s) c < (char32_t)(1L << s) char32_t c = string[i]; - if (c == 0) rc[j++] = 0xC0, rc[j++] = 0x80; + if (c == 0) rc[j++] = (char)0xC0, rc[j++] = (char)0x80; else if (_t( 7)) rc[j++] = (char)c; else if (_t(11)) rc[j++] = (char)((c >> 6) | 0xC0), _c( 0); else if (_t(16)) rc[j++] = (char)((c >> 12) | 0xE0), _c( 6), _c( 0); |