diff options
-rw-r--r-- | src/jid.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/jid.c b/src/jid.c index 0a722b1e..baeeb279 100644 --- a/src/jid.c +++ b/src/jid.c @@ -80,12 +80,12 @@ jid_create(const gchar * const str) gchar *domain_start = trimmed; - if (atp != NULL) { + if (atp) { result->localpart = g_utf8_substring(trimmed, 0, g_utf8_pointer_to_offset(trimmed, atp)); domain_start = atp + 1; } - if (slashp != NULL) { + if (slashp) { result->resourcepart = g_strdup(slashp + 1); result->domainpart = g_utf8_substring(domain_start, 0, g_utf8_pointer_to_offset(domain_start, slashp)); char *barejidraw = g_utf8_substring(trimmed, 0, g_utf8_pointer_to_offset(trimmed, slashp)); @@ -120,7 +120,7 @@ jid_create_from_bare_and_resource(const char * const room, const char * const ni void jid_destroy(Jid *jid) { - if (jid != NULL) { + if (jid) { g_free(jid->str); g_free(jid->localpart); g_free(jid->domainpart); @@ -169,8 +169,8 @@ get_nick_from_full_jid(const char * const full_room_jid) char **tokens = g_strsplit(full_room_jid, "/", 0); char *nick_part = NULL; - if (tokens != NULL) { - if (tokens[0] != NULL && tokens[1] != NULL) { + if (tokens) { + if (tokens[0] && tokens[1]) { nick_part = strdup(tokens[1]); } |