Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Veksler <Mihails.Vekslers@zabbix.com>2018-05-21 09:16:52 +0300
committerMichael Veksler <Mihails.Vekslers@zabbix.com>2018-05-21 09:16:52 +0300
commit4f9288ba232e2c3c4afcd95f61a947ea5ace42fb (patch)
treef54f7eff5c88ecacedc8bb3794c8e70bd4214e31 /tests/zbxmockdata.c
parent4072c16e4f80171827d28638f38dd74f390f958c (diff)
parent15c54825290717999b560695d519a37b2ee31166 (diff)
.......... [ZBX-13778] updated to the latest trunk
Diffstat (limited to 'tests/zbxmockdata.c')
-rw-r--r--tests/zbxmockdata.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/zbxmockdata.c b/tests/zbxmockdata.c
index 5dddefb0f4c..3e6568d2971 100644
--- a/tests/zbxmockdata.c
+++ b/tests/zbxmockdata.c
@@ -79,11 +79,14 @@ static const char *zbx_yaml_error_string(yaml_error_type_t error)
static int zbx_yaml_scalar_cmp(const char *str, const yaml_node_t *node)
{
+ size_t len;
+
if (YAML_SCALAR_NODE != node->type)
fail_msg("Internal error: scalar comparison of nonscalar node.");
- return strncmp(str, (const char *)node->data.scalar.value, node->data.scalar.length) ||
- strlen(str) > node->data.scalar.length;
+ len = strlen(str);
+ ZBX_RETURN_IF_NOT_EQUAL(len, node->data.scalar.length);
+ return memcmp(str, node->data.scalar.value, len);
}
static int zbx_yaml_scalar_ncmp(const char *str, size_t len, const yaml_node_t *node)