Skip to content

Commit bf2858d

Browse files
committed
Small compilation issue fixed
1 parent 228bdb0 commit bf2858d

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/database_sqlite.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ int database_select1value (db_t *db, const char *sql, char **ptr_value, db_int64
5858
if (rc != SQLITE_ROW) goto cleanup_select;
5959

6060
// sanity check column type
61-
int type = sqlite3_column_type(vm, 0);
61+
DBTYPE type = (DBTYPE)sqlite3_column_type(vm, 0);
6262
if (type == SQLITE_NULL) {rc = SQLITE_OK; goto cleanup_select;}
6363
if (type != expected_type) {rc = SQLITE_MISMATCH; goto cleanup_select;}
6464

src/network.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
#include <stdint.h>
1111
#include "network.h"
12-
#include "dbutils.h"
1312
#include "utils.h"
13+
#include "dbutils.h"
1414
#include "cloudsync.h"
1515
#include "cloudsync_private.h"
1616
#include "network_private.h"
@@ -683,7 +683,14 @@ void cloudsync_network_has_unsent_changes (sqlite3_context *context, int argc, s
683683

684684
// TODO: why hex(site_id) here if only one int column is returned?
685685
char *sql = "SELECT max(db_version), hex(site_id) FROM cloudsync_changes WHERE site_id == (SELECT site_id FROM cloudsync_site_id WHERE rowid=0)";
686-
int last_local_change = (int)dbutils_int_select(db, sql);
686+
db_int64 last_local_change = 0;
687+
int rc = database_select_int(db, sql, &last_local_change);
688+
if (rc != DBRES_OK) {
689+
sqlite3_result_error(context, sqlite3_errmsg(db), -1);
690+
sqlite3_result_error_code(context, rc);
691+
return;
692+
}
693+
687694
if (last_local_change == 0) {
688695
sqlite3_result_int(context, 0);
689696
return;

0 commit comments

Comments
 (0)