mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-13 12:40:17 +00:00
FS-11870 [core] fix divide by zero in previous commit
This commit is contained in:
parent
b06c7b0831
commit
6c1948e370
@ -109,9 +109,8 @@ SWITCH_DECLARE(cJSON *) switch_log_node_to_json(const switch_log_node_t *node, i
|
|||||||
}
|
}
|
||||||
if (json_format->timestamp.name) {
|
if (json_format->timestamp.name) {
|
||||||
double timestamp = node->timestamp;
|
double timestamp = node->timestamp;
|
||||||
double divisor = 0.0;
|
|
||||||
if (json_format->timestamp_divisor > 1.0) {
|
if (json_format->timestamp_divisor > 1.0) {
|
||||||
timestamp = timestamp / divisor;
|
timestamp = timestamp / json_format->timestamp_divisor;
|
||||||
}
|
}
|
||||||
cJSON_AddItemToObject(json, json_format->timestamp.name, cJSON_CreateNumber(timestamp));
|
cJSON_AddItemToObject(json, json_format->timestamp.name, cJSON_CreateNumber(timestamp));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user