Skip to content

Commit aec535f

Browse files
committed
Correct a bug when binding strings to prepared statements.
Fixes sql-js#52
1 parent faab828 commit aec535f

File tree

6 files changed

+4908
-4791
lines changed

6 files changed

+4908
-4791
lines changed

coffee/api.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ class Statement
159159
bindString: (string, pos = @pos++) ->
160160
bytes = intArrayFromString(string)
161161
@allocatedmem.push strptr = allocate bytes, 'i8', ALLOC_NORMAL
162-
@db.handleError sqlite3_bind_text @stmt, pos, strptr, bytes.length, 0
162+
@db.handleError sqlite3_bind_text @stmt, pos, strptr, bytes.length-1, 0
163163
return true
164164

165165
# @nodoc

0 commit comments

Comments
 (0)