Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rdmark committed Nov 14, 2024
1 parent 90fc114 commit 798b7d7
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions libatalk/cnid/sqlite/cnid_sqlite.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ cnid_t cnid_sqlite_lookup(struct _cnid_db *cdb,
char *retname;
int sqlite_return;

sqlite_return = sqlite3_step(stmt);
sqlite_return = sqlite3_step(db->cnid_lookup_stmt);
if (sqlite_return == SQLITE_DONE) {
/* not found (no rows) */
LOG(log_debug, logtype_cnid,
Expand All @@ -367,14 +367,14 @@ cnid_t cnid_sqlite_lookup(struct _cnid_db *cdb,
EC_FAIL;
}
/* got at least one row, store result in lookup_result_X */
lookup_result_id = sqlite3_column_int64(stmt, 1);
lookup_result_did = sqlite3_column_int64(stmt, 2);
snprintf(lookup_result_name, MAXPATHLEN-1, (const char *)sqlite3_column_text(stmt, 3));
lookup_result_id = sqlite3_column_int64(db->cnid_lookup_stmt, 1);
lookup_result_did = sqlite3_column_int64(db->cnid_lookup_stmt, 2);
snprintf(lookup_result_name, MAXPATHLEN-1, (const char *)sqlite3_column_text(db->cnid_lookup_stmt, 3));
lookup_result_name_len = strlen(lookup_result_name);
lookup_result_dev = sqlite3_column_int64(stmt, 4);
lookup_result_ino = sqlite3_column_int64(stmt, 5);
lookup_result_dev = sqlite3_column_int64(db->cnid_lookup_stmt, 4);
lookup_result_ino = sqlite3_column_int64(db->cnid_lookup_stmt, 5);

sqlite_return = sqlite3_step(stmt);
sqlite_return = sqlite3_step(db->cnid_lookup_stmt);
if (sqlite_return != SQLITE_DONE) {
/* We have more than one row */
/* a mismatch, delete both and return not found */
Expand Down Expand Up @@ -848,7 +848,7 @@ struct _cnid_db *cnid_sqlite_open(struct cnid_open_args *args)
&db->cnid_sqlite_con,
SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE, NULL))
{
LOG(log_error, logtype_cnid, "sqlite open error: %s",
LOG(log_error, logtype_cnid, "sqlite open error: %s, path: %s",
sqlite3_errmsg(db->cnid_sqlite_con));
EC_FAIL;
}
Expand Down

0 comments on commit 798b7d7

Please sign in to comment.