Commit 2d9ddd8d authored by Vladimír Čunát's avatar Vladimír Čunát

daemon/session nitpick: avoid a warning

lint:clang-scan-build reported:
> warning: The code calls sizeof() on a pointer type.
> This can produce an unexpected result
but in our case it's intentional.
(Yes, using pointers as keys in trie isn't very pretty.)
parent 5e621846
......@@ -148,7 +148,7 @@ int session_tasklist_add(struct session *session, struct qr_task *task)
key_len = sizeof(task_msg_id);
} else {
key = (const char *)&task;
key_len = sizeof(task);
key_len = sizeof(char *);
}
trie_val_t *v = trie_get_ins(t, key, key_len);
if (unlikely(!v)) {
......@@ -179,7 +179,7 @@ int session_tasklist_del(struct session *session, struct qr_task *task)
key_len = sizeof(task_msg_id);
} else {
key = (const char *)&task;
key_len = sizeof(task);
key_len = sizeof(char *);
}
int ret = trie_del(t, key, key_len, &val);
if (ret == kr_ok()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment