lua5.3.3 bugfix 2/3

This commit is contained in:
Cloud Wu
2016-08-01 14:18:13 +08:00
parent 9882dd1cfd
commit e2fa2a1a4d
2 changed files with 4 additions and 3 deletions

View File

@@ -260,7 +260,8 @@ static int getfield (lua_State *L, const char *key, int d, int delta) {
static const char *checkoption (lua_State *L, const char *conv, char *buff) {
const char *option;
int oplen = 1;
for (option = LUA_STRFTIMEOPTIONS; *option != '\0'; option += oplen) {
int convlen = (int)strlen(conv);
for (option = LUA_STRFTIMEOPTIONS; *option != '\0' && oplen <= convlen; option += oplen) {
if (*option == '|') /* next block? */
oplen++; /* next length */
else if (memcmp(conv, option, oplen) == 0) { /* match? */