10
10
#include <erl_nif.h>
11
11
#include <sqlite3.h>
12
12
13
- #include "utf8.h"
14
-
15
13
#define MAX_ATOM_LENGTH 255
16
14
#define MAX_PATHNAME 512
17
15
@@ -177,7 +175,7 @@ static ERL_NIF_TERM
177
175
make_sqlite3_error_tuple (ErlNifEnv * env , int rc , sqlite3 * db )
178
176
{
179
177
const char * msg = get_sqlite3_error_msg (rc , db );
180
- size_t len = utf8len (msg );
178
+ size_t len = strlen (msg );
181
179
182
180
return enif_make_tuple2 (
183
181
env ,
@@ -431,11 +429,11 @@ bind(ErlNifEnv* env, const ERL_NIF_TERM arg, sqlite3_stmt* statement, int index)
431
429
}
432
430
433
431
if (enif_get_atom (env , arg , the_atom , sizeof (the_atom ), ERL_NIF_LATIN1 )) {
434
- if (0 == utf8cmp ("undefined" , the_atom ) || 0 == utf8cmp ("nil" , the_atom )) {
432
+ if (0 == strcmp ("undefined" , the_atom ) || 0 == strcmp ("nil" , the_atom )) {
435
433
return sqlite3_bind_null (statement , index );
436
434
}
437
435
438
- return sqlite3_bind_text (statement , index , the_atom , utf8len (the_atom ), SQLITE_TRANSIENT );
436
+ return sqlite3_bind_text (statement , index , the_atom , strlen (the_atom ), SQLITE_TRANSIENT );
439
437
}
440
438
441
439
if (enif_inspect_iolist_as_binary (env , arg , & the_blob )) {
@@ -448,7 +446,7 @@ bind(ErlNifEnv* env, const ERL_NIF_TERM arg, sqlite3_stmt* statement, int index)
448
446
}
449
447
450
448
if (enif_get_atom (env , tuple [0 ], the_atom , sizeof (the_atom ), ERL_NIF_LATIN1 )) {
451
- if (0 == utf8ncmp ("blob" , the_atom , 4 )) {
449
+ if (0 == strcmp ("blob" , the_atom )) {
452
450
if (enif_inspect_iolist_as_binary (env , tuple [1 ], & the_blob )) {
453
451
return sqlite3_bind_blob (statement , index , the_blob .data , the_blob .size , SQLITE_TRANSIENT );
454
452
}
@@ -716,7 +714,7 @@ exqlite_columns(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
716
714
return make_error_tuple (env , "out_of_memory" );
717
715
}
718
716
719
- columns [i ] = make_binary (env , name , utf8len (name ));
717
+ columns [i ] = make_binary (env , name , strlen (name ));
720
718
}
721
719
722
720
result = enif_make_list_from_array (env , columns , size );
0 commit comments