diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-02-09 16:05:46 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-02-09 16:05:46 -0200 |
commit | 2a57d2346e2536b4ce954357a67c673c7ebe4adb (patch) | |
tree | eb18b017e634ac537634ab1c35ac33588dd3d66b /lstrlib.c | |
parent | 7e425be975c7c5bedff234a0daeb803131ddfc60 (diff) | |
download | lua-2a57d2346e2536b4ce954357a67c673c7ebe4adb.tar.gz lua-2a57d2346e2536b4ce954357a67c673c7ebe4adb.tar.bz2 lua-2a57d2346e2536b4ce954357a67c673c7ebe4adb.zip |
detail
Diffstat (limited to 'lstrlib.c')
-rw-r--r-- | lstrlib.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstrlib.c,v 1.224 2015/02/04 12:54:31 roberto Exp roberto $ | 2 | ** $Id: lstrlib.c,v 1.225 2015/02/05 17:50:24 roberto Exp roberto $ |
3 | ** Standard library for string operations and pattern-matching | 3 | ** Standard library for string operations and pattern-matching |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -823,7 +823,7 @@ static int str_gsub (lua_State *L) { | |||
823 | ** Add integer part of 'x' to buffer and return new 'x' | 823 | ** Add integer part of 'x' to buffer and return new 'x' |
824 | */ | 824 | */ |
825 | static lua_Number adddigit (char *buff, int n, lua_Number x) { | 825 | static lua_Number adddigit (char *buff, int n, lua_Number x) { |
826 | double dd = l_mathop(floor)(x); /* get integer part from 'x' */ | 826 | lua_Number dd = l_mathop(floor)(x); /* get integer part from 'x' */ |
827 | int d = (int)dd; | 827 | int d = (int)dd; |
828 | buff[n] = (d < 10 ? d + '0' : d - 10 + 'a'); /* add to buffer */ | 828 | buff[n] = (d < 10 ? d + '0' : d - 10 + 'a'); /* add to buffer */ |
829 | return x - dd; /* return what is left */ | 829 | return x - dd; /* return what is left */ |