GCC12: Fixes for 18+. state_id_by_topic comparing wrong value

GCC 12 caught an issue in state_id_by_topic where we were
checking a pointer for NULL instead of the contents of
the pointer for '\0'.

ASTERISK-30044

Change-Id: Ia0b04d4fff45c92acb7f07132a33622fa341148e
This commit is contained in:
George Joseph 2022-05-04 12:00:27 -06:00 committed by Joshua Colp
parent 8fdc6008a4
commit 49108810d1
1 changed files with 1 additions and 1 deletions

View File

@ -113,7 +113,7 @@ static const char *state_id_by_topic(struct stasis_topic *manager_topic,
id = strchr(stasis_topic_name(state_topic), '/');
/* The state's unique id should always exist */
ast_assert(id != NULL && (id + 1) != NULL);
ast_assert(id != NULL && *(id + 1) != '\0');
return (id + 1);
}