diff --git a/luabind/detail/format_signature.hpp b/luabind/detail/format_signature.hpp index 22922535..e0b53e79 100644 --- a/luabind/detail/format_signature.hpp +++ b/luabind/detail/format_signature.hpp @@ -138,8 +138,9 @@ void format_signature(lua_State* L, char const* function, Signature) , typename mpl::end::type() ); lua_pushliteral(L, ")"); - - lua_concat(L, static_cast(mpl::size()) * 2 + 2); + int const signature_len = static_cast(mpl::size()); + lua_concat(L, signature_len * 2 + (signature_len == 1 ? + 3 /* zero-argument function: account for ')' */ : 2)); } }} // namespace luabind::detail