Skip to content

Commit b0e3c8d

Browse files
authored
Sqlite takes bind text16 sizes in bytes
1 parent dffc090 commit b0e3c8d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hdr/sqlite_modern_cpp/type_wrapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ namespace sqlite {
200200

201201
// Convert char* to string_view to trigger op<<(..., const str_ref )
202202
template<std::size_t N> inline int bind_col_in_db(sqlite3_stmt* stmt, int inx, const char16_t(&STR)[N]) {
203-
return sqlite3_bind_text16(stmt, inx, &STR[0], N-1, SQLITE_TRANSIENT);
203+
return sqlite3_bind_text16(stmt, inx, &STR[0], sizeof(char16_t) * (N-1), SQLITE_TRANSIENT);
204204
}
205205

206206
inline std::u16string get_col_from_db(sqlite3_stmt* stmt, int inx, result_type<std::u16string>) {

0 commit comments

Comments
 (0)