]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-11870 [core] fix divide by zero in previous commit
authorChris Rienzo <chris@signalwire.com>
Fri, 31 May 2019 14:08:33 +0000 (14:08 +0000)
committerAndrey Volk <andywolk@gmail.com>
Wed, 17 Jul 2019 20:08:02 +0000 (00:08 +0400)
src/switch_log.c

index fa0ae6d7c5202fb0c4486a76fa5131f75f742d29..055298915ca4726d90dcdc67fa9e64ec426b4c2d 100644 (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));
        }