mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-04-27 17:24:43 +00:00
This removes strdup from Lua SQLite wrapper, as it's applied to binary changeset strings, thus cutting them short (because of strlen).
This commit is contained in:
parent
f25beb341c
commit
5c1fdc9819
1 changed files with 2 additions and 2 deletions
|
@ -2312,7 +2312,7 @@ static int db_concat_changeset(lua_State *L) {
|
||||||
int rc = sqlite3changegroup_new(&pGrp);
|
int rc = sqlite3changegroup_new(&pGrp);
|
||||||
for (int i = 1; rc == SQLITE_OK && i <= n; i++) {
|
for (int i = 1; rc == SQLITE_OK && i <= n; i++) {
|
||||||
lua_rawgeti(L, 2, i);
|
lua_rawgeti(L, 2, i);
|
||||||
cset = gc(strdup(lua_tostring(L, -1)));
|
cset = (void *)lua_tostring(L, -1);
|
||||||
nset = lua_rawlen(L, -1);
|
nset = lua_rawlen(L, -1);
|
||||||
rc = sqlite3changegroup_add(pGrp, nset, cset);
|
rc = sqlite3changegroup_add(pGrp, nset, cset);
|
||||||
lua_pop(L, 1); // pop the string
|
lua_pop(L, 1); // pop the string
|
||||||
|
@ -2328,7 +2328,7 @@ static int db_concat_changeset(lua_State *L) {
|
||||||
|
|
||||||
static int db_apply_changeset(lua_State *L) {
|
static int db_apply_changeset(lua_State *L) {
|
||||||
sdb *db = lsqlite_checkdb(L, 1);
|
sdb *db = lsqlite_checkdb(L, 1);
|
||||||
char *cset = gc(strdup(luaL_checkstring(L, 2)));
|
void *cset = (void *)luaL_checkstring(L, 2);
|
||||||
int nset = lua_rawlen(L, 2);
|
int nset = lua_rawlen(L, 2);
|
||||||
int top = lua_gettop(L);
|
int top = lua_gettop(L);
|
||||||
int rc;
|
int rc;
|
||||||
|
|
Loading…
Add table
Reference in a new issue