diff options
author | Arun Raghavan <arun.raghavan@collabora.co.uk> | 2012-03-19 14:16:04 +0530 |
---|---|---|
committer | Arun Raghavan <arun.raghavan@collabora.co.uk> | 2012-03-19 14:16:04 +0530 |
commit | fd637e87657ab944f28de422564bca71f9be579b (patch) | |
tree | cd14c243a15fb77b791b435648f560749d5e6e52 | |
parent | 54cddc6ddf075b6248b0b8521120b2bd86049978 (diff) |
protocol-native: Reinstate assert that was incorrectly removed
Commit 54cddc6ddf075b6248b0b8521120b2bd86049978 removed an assert that
looked redundant but was not. This commit reinstates it in a slightly
modified form. It is not stated as (a ^ b) instead of (!a || !b) in
order to make the condition more obvious.
-rw-r--r-- | src/pulsecore/protocol-native.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c index 34fff6e7..9a437ffb 100644 --- a/src/pulsecore/protocol-native.c +++ b/src/pulsecore/protocol-native.c @@ -4699,6 +4699,7 @@ static void command_set_sink_or_source_port(pa_pdispatch *pd, uint32_t command, CHECK_VALIDITY(c->pstream, !name || pa_namereg_is_valid_name_or_wildcard(name, command == PA_COMMAND_SET_SINK_PORT ? PA_NAMEREG_SINK : PA_NAMEREG_SOURCE), tag, PA_ERR_INVALID); CHECK_VALIDITY(c->pstream, idx != PA_INVALID_INDEX || name, tag, PA_ERR_INVALID); CHECK_VALIDITY(c->pstream, idx == PA_INVALID_INDEX || !name, tag, PA_ERR_INVALID); + CHECK_VALIDITY(c->pstream, (idx != PA_INVALID_INDEX) ^ (name != NULL), tag, PA_ERR_INVALID); CHECK_VALIDITY(c->pstream, port, tag, PA_ERR_INVALID); if (command == PA_COMMAND_SET_SINK_PORT) { |