Fix crash due to int64 cast to a %ld format.

This commit is contained in:
Isaac Connor 2021-09-23 19:07:07 -04:00
parent aae967e895
commit c78e035057
1 changed files with 2 additions and 3 deletions

View File

@ -109,7 +109,7 @@ Event::Event(
"INSERT INTO `Events` " "INSERT INTO `Events` "
"( `MonitorId`, `StorageId`, `Name`, `StartDateTime`, `Width`, `Height`, `Cause`, `Notes`, `StateId`, `Orientation`, `Videoed`, `DefaultVideo`, `SaveJPEGs`, `Scheme` )" "( `MonitorId`, `StorageId`, `Name`, `StartDateTime`, `Width`, `Height`, `Cause`, `Notes`, `StateId`, `Orientation`, `Videoed`, `DefaultVideo`, `SaveJPEGs`, `Scheme` )"
" VALUES " " VALUES "
"( %d, %d, 'New Event', from_unixtime( %ld ), %d, %d, '%s', '%s', %d, %d, %d, '%s', %d, '%s' )", "( %d, %d, 'New Event', from_unixtime(%" PRId64 "), %u, %u, '%s', '%s', %d, %d, %d, '%s', %d, '%s' )",
monitor->Id(), monitor->Id(),
storage->Id(), storage->Id(),
static_cast<int64>(std::chrono::system_clock::to_time_t(start_time)), static_cast<int64>(std::chrono::system_clock::to_time_t(start_time)),
@ -124,7 +124,6 @@ Event::Event(
save_jpegs, save_jpegs,
storage->SchemeString().c_str() storage->SchemeString().c_str()
); );
id = zmDbDoInsert(sql); id = zmDbDoInsert(sql);
if ( !SetPath(storage) ) { if ( !SetPath(storage) ) {