FS-11870 [core] fix divide by zero in previous commit

This commit is contained in:
Chris Rienzo 2019-05-31 14:08:33 +00:00 committed by Andrey Volk
parent b06c7b0831
commit 6c1948e370
1 changed files with 1 additions and 2 deletions

View File

@ -109,9 +109,8 @@ SWITCH_DECLARE(cJSON *) switch_log_node_to_json(const switch_log_node_t *node, i
}
if (json_format->timestamp.name) {
double timestamp = node->timestamp;
double divisor = 0.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));
}