diff options
Diffstat (limited to 'lobject.c')
-rw-r--r-- | lobject.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lobject.c,v 2.92 2014/10/10 22:23:04 roberto Exp roberto $ | 2 | ** $Id: lobject.c,v 2.93 2014/10/17 16:28:21 roberto Exp roberto $ |
3 | ** Some generic functions over Lua objects | 3 | ** Some generic functions over Lua objects |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -317,8 +317,8 @@ int luaO_utf8esc (char *buff, unsigned long x) { | |||
317 | buff[UTF8BUFFSZ - 1] = cast(char, x); | 317 | buff[UTF8BUFFSZ - 1] = cast(char, x); |
318 | else { /* need continuation bytes */ | 318 | else { /* need continuation bytes */ |
319 | unsigned int mfb = 0x3f; /* maximum that fits in first byte */ | 319 | unsigned int mfb = 0x3f; /* maximum that fits in first byte */ |
320 | do { | 320 | do { /* add continuation bytes */ |
321 | buff[UTF8BUFFSZ - (n++)] = 0x80 | (x & 0x3f); /* add continuation byte */ | 321 | buff[UTF8BUFFSZ - (n++)] = cast(char, 0x80 | (x & 0x3f)); |
322 | x >>= 6; /* remove added bits */ | 322 | x >>= 6; /* remove added bits */ |
323 | mfb >>= 1; /* now there is one less bit available in first byte */ | 323 | mfb >>= 1; /* now there is one less bit available in first byte */ |
324 | } while (x > mfb); /* still needs continuation byte? */ | 324 | } while (x > mfb); /* still needs continuation byte? */ |