Fix crash due to int64 cast to a %ld format.
This commit is contained in:
parent
aae967e895
commit
c78e035057
|
@ -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)),
|
||||||
|
@ -120,11 +120,10 @@ Event::Event(
|
||||||
state_id,
|
state_id,
|
||||||
monitor->getOrientation(),
|
monitor->getOrientation(),
|
||||||
0,
|
0,
|
||||||
"",
|
"",
|
||||||
save_jpegs,
|
save_jpegs,
|
||||||
storage->SchemeString().c_str()
|
storage->SchemeString().c_str()
|
||||||
);
|
);
|
||||||
|
|
||||||
id = zmDbDoInsert(sql);
|
id = zmDbDoInsert(sql);
|
||||||
|
|
||||||
if ( !SetPath(storage) ) {
|
if ( !SetPath(storage) ) {
|
||||||
|
|
Loading…
Reference in New Issue