Skip to content

Commit

Permalink
love.graphics.print doesn't stop at \0
Browse files Browse the repository at this point in the history
  • Loading branch information
slime73 committed Dec 1, 2024
1 parent fe4fc84 commit 58000b4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/modules/graphics/wrap_Font.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ void luax_checkcoloredstring(lua_State *L, int idx, std::vector<love::font::Colo
}
else
{
coloredstr.str = luaL_checkstring(L, -1);
size_t strl = 0;
const char *str = luaL_checklstring(L, -1, &strl);
coloredstr.str.assign(str, strl);
strings.push_back(coloredstr);
}

Expand All @@ -66,7 +68,9 @@ void luax_checkcoloredstring(lua_State *L, int idx, std::vector<love::font::Colo
}
else
{
coloredstr.str = luaL_checkstring(L, idx);
size_t strl = 0;
const char *str = luaL_checklstring(L, idx, &strl);
coloredstr.str.assign(str, strl);
strings.push_back(coloredstr);
}
}
Expand Down

0 comments on commit 58000b4

Please sign in to comment.