Skip to content
This repository was archived by the owner on Apr 5, 2025. It is now read-only.

Commit 4bf8177

Browse files
committed
Fix index for cams. Closes #198
1 parent 3e28491 commit 4bf8177

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/dbse.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -978,9 +978,11 @@ void cls_dbse::filelist_get(std::string sql, vec_files &p_flst)
978978
{
979979
int indx;
980980
if (dbse_open() == false) {
981+
p_flst.clear();
981982
return;
982983
}
983984
if (finish == true) {
985+
p_flst.clear();
984986
return;
985987
}
986988

@@ -1193,19 +1195,19 @@ void cls_dbse::dbse_edits()
11931195

11941196
void cls_dbse::dbse_clean()
11951197
{
1196-
int delcnt, indx;
1198+
int delcnt, indx, camindx;
11971199
std::string sql, delimit;
11981200
struct stat statbuf;
11991201
vec_files flst;
12001202

1201-
for (indx=0;indx<app->cam_cnt;indx++) {
1203+
for (camindx=0;camindx<app->cam_cnt;camindx++) {
12021204
if (check_exit() == true) {
12031205
return;
12041206
}
12051207

12061208
sql = " select * from motionplus ";
12071209
sql += " where device_id = ";
1208-
sql += std::to_string(app->cam_list[indx]->cfg->device_id);
1210+
sql += std::to_string(app->cam_list[camindx]->cfg->device_id);
12091211
sql += " order by file_dtl, file_tml;";
12101212
filelist_get(sql, flst);
12111213

0 commit comments

Comments
 (0)