mirror of
https://github.com/strongswan/strongswan.git
synced 2025-10-03 00:00:24 -04:00
unit-tests: Fix compiler warning with empty message assertion
The empty array of rules for `assert_message_empty()` and the resulting size 0 triggers warnings like these: allocation of insufficient size '0' for type 'listener_message_rule_t' with size '12' Using calloc() with `nmemb` set to 0 triggers the same warning.
This commit is contained in:
parent
6eec5cc07d
commit
0602ed1043
@ -357,7 +357,7 @@ bool exchange_test_asserts_message(listener_t *this, ike_sa_t *ike_sa,
|
||||
.line = __LINE__, \
|
||||
.incoming = streq(dir, "IN") ? TRUE : FALSE, \
|
||||
.count = c, \
|
||||
.rules = malloc(sizeof(_rules)), \
|
||||
.rules = sizeof(_rules) ? malloc(sizeof(_rules)) : NULL, \
|
||||
.num_rules = countof(_rules), \
|
||||
); \
|
||||
memcpy(_listener->rules, _rules, sizeof(_rules)); \
|
||||
|
Loading…
x
Reference in New Issue
Block a user