about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-05-04 23:27:41 +0100
committerJames Booth <boothj5@gmail.com>2015-05-04 23:27:41 +0100
commit4c78534be0e78be94bc7cd23ec1e2f644ebbd27f (patch)
treedc4adbe2d101b92c6f3316d9b588b1b079b274c1
parent1bfaa49fb3cd61878c85eb5bfad202a798fb8b0a (diff)
downloadprofani-tty-4c78534be0e78be94bc7cd23ec1e2f644ebbd27f.tar.gz
Use null check convention in jid.c
-rw-r--r--src/jid.c10
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]);
         }