Core: Fix warning

This commit is contained in:
Vicki Pfau 2022-06-24 00:53:15 -07:00
parent 1a61da9f83
commit b1f1da4f7d
1 changed files with 4 additions and 1 deletions

View File

@ -381,9 +381,12 @@ size_t mLibraryGetEntries(struct mLibrary* library, struct mLibraryListing* out,
sqlite3_reset(library->select);
_bindConstraints(library->select, constraints);
if (numEntries > SSIZE_MAX) {
numEntries = SSIZE_MAX;
}
int countIndex = sqlite3_bind_parameter_index(library->select, ":count");
int offsetIndex = sqlite3_bind_parameter_index(library->select, ":offset");
sqlite3_bind_int64(library->select, countIndex, numEntries ? numEntries : -1);
sqlite3_bind_int64(library->select, countIndex, numEntries ? (ssize_t) numEntries : -1);
sqlite3_bind_int64(library->select, offsetIndex, offset);
size_t entryIndex;