mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-11-11 00:23:47 +01:00
Bind correctly
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
parent
ae97de3ab5
commit
39cdfdb99a
@ -778,8 +778,14 @@ sqlite_get_recent_files(zathura_database_t* db, int max, const char* basepath)
|
|||||||
max = INT_MAX;
|
max = INT_MAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sqlite3_bind_int(stmt, 1, max) != SQLITE_OK &&
|
bool failed = false;
|
||||||
(basepath == NULL || sqlite3_bind_text(stmt, 2, basepath, -1, NULL) != SQLITE_OK)) {
|
if (basepath != NULL) {
|
||||||
|
failed = sqlite3_bind_int(stmt, 2, max) != SQLITE_OK || sqlite3_bind_text(stmt, 1, basepath, -1, NULL) != SQLITE_OK;
|
||||||
|
} else {
|
||||||
|
failed = sqlite3_bind_int(stmt, 1, max) != SQLITE_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (failed == true) {
|
||||||
sqlite3_finalize(stmt);
|
sqlite3_finalize(stmt);
|
||||||
girara_error("Failed to bind arguments.");
|
girara_error("Failed to bind arguments.");
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user