[core] fix switch_mprintf format string

Segfaults on 32-bit platforms running musl 1.2.x.

Reported-by: Sebastian Kemper <sebastian_ml@gmx.net>
This commit is contained in:
Érico Nogueira 2021-10-29 00:17:05 -03:00
parent aad8b0ecb4
commit ec0c59a798
1 changed files with 1 additions and 1 deletions

View File

@ -3551,7 +3551,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_expire_registration(int force)
if (force) {
sql = switch_mprintf("delete from registrations where hostname='%q'", switch_core_get_switchname());
} else {
sql = switch_mprintf("delete from registrations where expires > 0 and expires <= %ld and hostname='%q'", now, switch_core_get_switchname());
sql = switch_mprintf("delete from registrations where expires > 0 and expires <= %" TIME_T_FMT " and hostname='%q'", TIME_T_CAST(now), switch_core_get_switchname());
}
switch_sql_queue_manager_push(sql_manager.qm, sql, 0, SWITCH_FALSE);