Changeset 5b01e1a


Ignore:
Timestamp:
2015-11-24T15:05:41Z (9 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
7554702
Parents:
ad9ac5d
Message:

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".

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/presence.c

    rad9ac5d r5b01e1a  
    186186        char *prio = set_getstr(&ic->acc->set, "priority");
    187187
    188         if (jd->away_state->code != NULL) {
     188        if (jd->away_state && jd->away_state->full_name != NULL) {
    189189                int new_prio = (atoi(prio) - 5);
    190190                if (new_prio < 0) {
Note: See TracChangeset for help on using the changeset viewer.