memory bugfix, vbump

This commit is contained in:
2020-01-26 22:14:25 +01:00
parent e239ac2b7f
commit 9743ac15d9
4 changed files with 6 additions and 4 deletions

View File

@@ -6,7 +6,7 @@ everything, but it tries to be useful.
## Installation
```clojure
(load "https://veitheller.de/git/carpentry/sqlite3@0.0.1")
(load "https://veitheller.de/git/carpentry/sqlite3@0.0.2")
```
## Usage

View File

@@ -1,6 +1,8 @@
(load "sqlite3.carp")
(use SQLite3)
(add-cflag "-fsanitize=address")
(defn main []
(let-do [db (Result.unsafe-from-success (SQLite3.open "test.db"))]
; we can create a table

View File

@@ -7,7 +7,7 @@ to wrap everything, but it tries to be useful.
## Installation
```clojure
(load \"https://veitheller.de/git/carpentry/sqlite3@0.0.1\")
(load \"https://veitheller.de/git/carpentry/sqlite3@0.0.2\")
```
## Usage

View File

@@ -176,14 +176,14 @@ const char* SQLite3_exec_internal(sqlite3_stmt* s, SQLiteRows* rows) {
break;
case SQLITE_TEXT: {
len = sqlite3_column_bytes(s, i);
c->s = CARP_MALLOC(len);
c->s = CARP_MALLOC(len+1);
memcpy(c->s, sqlite3_column_text(s, i), len);
c->s[len] = '\0';
break;
}
case SQLITE_BLOB: {
len = sqlite3_column_bytes(s, i);
c->s = CARP_MALLOC(len);
c->s = CARP_MALLOC(len+1);
memcpy(c->s, sqlite3_column_blob(s, i), len);
c->s[len] = '\0';
break;