about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-05-04 22:33:55 +0100
committerJames Booth <boothj5@gmail.com>2015-05-04 22:33:55 +0100
commit4ba33005d0e5333ff15d9af40663741f6884c649 (patch)
tree75312592c5d64827c450e10742867070b239bd09
parentb093b99c15c109eb56f0386f8add5529b5e76a4c (diff)
downloadprofani-tty-4ba33005d0e5333ff15d9af40663741f6884c649.tar.gz
Use null check convention in theme.c
-rw-r--r--src/config/theme.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/config/theme.c b/src/config/theme.c
index 1ee9836b..f73dee19 100644
--- a/src/config/theme.c
+++ b/src/config/theme.c
@@ -160,7 +160,7 @@ _theme_load_file(const char * const theme_name)
 {
     // use default theme
     if (theme_name == NULL || strcmp(theme_name, "default") == 0) {
-        if (theme != NULL) {
+        if (theme) {
             g_key_file_free(theme);
         }
         theme = g_key_file_new();
@@ -173,12 +173,12 @@ _theme_load_file(const char * const theme_name)
             return FALSE;
         }
 
-        if (theme_loc != NULL) {
+        if (theme_loc) {
             g_string_free(theme_loc, TRUE);
         }
         theme_loc = new_theme_file;
         log_info("Loading theme \"%s\"", theme_name);
-        if (theme != NULL) {
+        if (theme) {
             g_key_file_free(theme);
         }
         theme = g_key_file_new();
@@ -205,10 +205,10 @@ theme_list(void)
 void
 theme_close(void)
 {
-    if (theme != NULL) {
+    if (theme) {
         g_key_file_free(theme);
     }
-    if (theme_loc != NULL) {
+    if (theme_loc) {
         g_string_free(theme_loc, TRUE);
     }
     if (bold_items) {
@@ -476,9 +476,9 @@ void
 _theme_list_dir(const gchar * const dir, GSList **result)
 {
     GDir *themes = g_dir_open(dir, 0, NULL);
-    if (themes != NULL) {
+    if (themes) {
         const gchar *theme = g_dir_read_name(themes);
-        while (theme != NULL) {
+        while (theme) {
             *result = g_slist_append(*result, strdup(theme));
             theme = g_dir_read_name(themes);
         }
@@ -492,7 +492,7 @@ _theme_find(const char * const theme_name)
     GString *path = NULL;
     gchar *themes_dir = _get_themes_dir();
 
-    if (themes_dir != NULL) {
+    if (themes_dir) {
         path = g_string_new(themes_dir);
         g_free(themes_dir);
         g_string_append(path, "/");