diff --git a/src/kamokan_impl/lua_to_cpp.cmake b/src/kamokan_impl/lua_to_cpp.cmake index 18987ec..e921625 100644 --- a/src/kamokan_impl/lua_to_cpp.cmake +++ b/src/kamokan_impl/lua_to_cpp.cmake @@ -14,8 +14,8 @@ set(lua_scripts_for_redis_content "//File autogenerated by cmake, changes will b namespace kamokan { extern const char g_save_script[] = R\"lua(${save_pastie})lua\"; extern const char g_load_script[] = R\"lua(${retrieve_pastie})lua\"; -extern const std::size_t g_save_script_size = ${save_pastie_length} + 1; -extern const std::size_t g_load_script_size = ${retrieve_pastie_length} + 1; +extern const std::size_t g_save_script_size = ${save_pastie_length}; +extern const std::size_t g_load_script_size = ${retrieve_pastie_length}; } //namespace kamokan ") diff --git a/src/kamokan_impl/storage.cpp b/src/kamokan_impl/storage.cpp index b557c32..aed733b 100644 --- a/src/kamokan_impl/storage.cpp +++ b/src/kamokan_impl/storage.cpp @@ -175,7 +175,7 @@ namespace kamokan { if (not retval.valid_token) return retval; - redis::Script retrieve = m_redis->command().make_script(boost::string_view(g_load_script, g_load_script_size - 1)); + redis::Script retrieve = m_redis->command().make_script(boost::string_view(g_load_script, g_load_script_size)); auto batch = m_redis->command().make_batch(); retrieve.run(batch, std::make_tuple(parToken), std::make_tuple()); auto raw_replies = batch.replies();