diff options
Diffstat (limited to 'lobject.c')
| -rw-r--r-- | lobject.c | 8 |
1 files changed, 4 insertions, 4 deletions
| @@ -247,7 +247,7 @@ static lua_Number lua_strx2number (const char *s, char **endptr) { | |||
| 247 | nosigdig++; | 247 | nosigdig++; |
| 248 | else if (++sigdig <= MAXSIGDIG) /* can read it without overflow? */ | 248 | else if (++sigdig <= MAXSIGDIG) /* can read it without overflow? */ |
| 249 | r = (r * l_mathop(16.0)) + luaO_hexavalue(*s); | 249 | r = (r * l_mathop(16.0)) + luaO_hexavalue(*s); |
| 250 | else e++; /* too many digits; ignore, but still count for exponent */ | 250 | else e++; /* too many digits; ignore, but still count for exponent */ |
| 251 | if (hasdot) e--; /* decimal digit? correct exponent */ | 251 | if (hasdot) e--; /* decimal digit? correct exponent */ |
| 252 | } | 252 | } |
| 253 | else break; /* neither a dot nor a digit */ | 253 | else break; /* neither a dot nor a digit */ |
| @@ -512,18 +512,18 @@ static void initbuff (lua_State *L, BuffFS *buff) { | |||
| 512 | static void pushbuff (lua_State *L, void *ud) { | 512 | static void pushbuff (lua_State *L, void *ud) { |
| 513 | BuffFS *buff = cast(BuffFS*, ud); | 513 | BuffFS *buff = cast(BuffFS*, ud); |
| 514 | switch (buff->err) { | 514 | switch (buff->err) { |
| 515 | case 1: | 515 | case 1: /* memory error */ |
| 516 | luaD_throw(L, LUA_ERRMEM); | 516 | luaD_throw(L, LUA_ERRMEM); |
| 517 | break; | 517 | break; |
| 518 | case 2: /* length overflow: Add "..." at the end of result */ | 518 | case 2: /* length overflow: Add "..." at the end of result */ |
| 519 | if (buff->buffsize - buff->blen < 3) | 519 | if (buff->buffsize - buff->blen < 3) |
| 520 | strcpy(buff->b + buff->blen - 3, "..."); /* 'blen' must be > 3 */ | 520 | strcpy(buff->b + buff->blen - 3, "..."); /* 'blen' must be > 3 */ |
| 521 | else { /* there is enough space left for the "..." */ | 521 | else { /* there is enough space left for the "..." */ |
| 522 | strcpy(buff->b + buff->blen, "..."); | 522 | strcpy(buff->b + buff->blen, "..."); |
| 523 | buff->blen += 3; | 523 | buff->blen += 3; |
| 524 | } | 524 | } |
| 525 | /* FALLTHROUGH */ | 525 | /* FALLTHROUGH */ |
| 526 | default: { /* no errors */ | 526 | default: { /* no errors, but it can raise one creating the new string */ |
| 527 | TString *ts = luaS_newlstr(L, buff->b, buff->blen); | 527 | TString *ts = luaS_newlstr(L, buff->b, buff->blen); |
| 528 | setsvalue2s(L, L->top.p, ts); | 528 | setsvalue2s(L, L->top.p, ts); |
| 529 | L->top.p++; | 529 | L->top.p++; |
