Slightly better error message for invalid conversions in 'string.format'.
This commit is contained in:
Roberto Ierusalimschy
2018-12-27 14:19:53 -02:00
parent 662506476b
commit da37ac9c78
2 changed files with 2 additions and 3 deletions

View File

@@ -1180,8 +1180,7 @@ static int str_format (lua_State *L) {
break;
}
default: { /* also treat cases 'pnLlh' */
return luaL_error(L, "invalid option '%%%c' to 'format'",
*(strfrmt - 1));
return luaL_error(L, "invalid conversion '%s' to 'format'", form);
}
}
lua_assert(nb < MAX_ITEM);