diff options
Diffstat (limited to 'lobject.c')
-rw-r--r-- | lobject.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -343,7 +343,7 @@ size_t luaO_str2num (const char *s, TValue *o) { | |||
343 | 343 | ||
344 | int luaO_utf8esc (char *buff, unsigned long x) { | 344 | int luaO_utf8esc (char *buff, unsigned long x) { |
345 | int n = 1; /* number of bytes put in buffer (backwards) */ | 345 | int n = 1; /* number of bytes put in buffer (backwards) */ |
346 | lua_assert(x <= 0x10FFFF); | 346 | lua_assert(x <= 0x7FFFFFFFu); |
347 | if (x < 0x80) /* ascii? */ | 347 | if (x < 0x80) /* ascii? */ |
348 | buff[UTF8BUFFSZ - 1] = cast_char(x); | 348 | buff[UTF8BUFFSZ - 1] = cast_char(x); |
349 | else { /* need continuation bytes */ | 349 | else { /* need continuation bytes */ |
@@ -435,9 +435,9 @@ const char *luaO_pushvfstring (lua_State *L, const char *fmt, va_list argp) { | |||
435 | pushstr(L, buff, l); | 435 | pushstr(L, buff, l); |
436 | break; | 436 | break; |
437 | } | 437 | } |
438 | case 'U': { /* an 'int' as a UTF-8 sequence */ | 438 | case 'U': { /* a 'long' as a UTF-8 sequence */ |
439 | char buff[UTF8BUFFSZ]; | 439 | char buff[UTF8BUFFSZ]; |
440 | int l = luaO_utf8esc(buff, cast(long, va_arg(argp, long))); | 440 | int l = luaO_utf8esc(buff, va_arg(argp, long)); |
441 | pushstr(L, buff + UTF8BUFFSZ - l, l); | 441 | pushstr(L, buff + UTF8BUFFSZ - l, l); |
442 | break; | 442 | break; |
443 | } | 443 | } |