diff options
| author | dequis <dx@dxzone.com.ar> | 2015-11-24 12:05:41 -0300 | 
|---|---|---|
| committer | dequis <dx@dxzone.com.ar> | 2015-11-24 12:05:41 -0300 | 
| commit | 5b01e1a5b69d9a86833dcd54046fe6a7832efec8 (patch) | |
| tree | bcf235ba0f4b4afe9c2da75a0065c8cd3e58f714 /protocols | |
| parent | ad9ac5dccf8d27700850c02946ad3242a45d6fa9 (diff) | |
jabber: Fix detection of away state in choose_priority()
Thanks to this clang warning:
    comparison of array 'jd->away_state->code' not equal to a null
    pointer is always true [-Wtautological-pointer-compare]
Although... given how ->code is offset 0, that might have worked
sometimes if jd->away_state is null, assuming a compiler that doesn't
hate humanity. Sadly, that is not something we can safely assume.
I bet gcc saw this and thought "let's optimize your poor soul away".
Diffstat (limited to 'protocols')
| -rw-r--r-- | protocols/jabber/presence.c | 2 | 
1 files changed, 1 insertions, 1 deletions
| diff --git a/protocols/jabber/presence.c b/protocols/jabber/presence.c index c8664a24..14060148 100644 --- a/protocols/jabber/presence.c +++ b/protocols/jabber/presence.c @@ -185,7 +185,7 @@ static char *choose_priority(struct im_connection *ic)  	struct jabber_data *jd = ic->proto_data;  	char *prio = set_getstr(&ic->acc->set, "priority"); -	if (jd->away_state->code != NULL) { +	if (jd->away_state && jd->away_state->full_name != NULL) {  		int new_prio = (atoi(prio) - 5);  		if (new_prio < 0) {  			new_prio = 0; | 
