diff options
author | James Booth <boothj5@gmail.com> | 2015-05-04 22:33:19 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2015-05-04 22:33:19 +0100 |
commit | b093b99c15c109eb56f0386f8add5529b5e76a4c (patch) | |
tree | 2de24f43e341c2da30b4fe96767b30aa71fcdc47 | |
parent | a293045d855ab04aa9beff7924e1f5ec2d0403fc (diff) | |
download | profani-tty-b093b99c15c109eb56f0386f8add5529b5e76a4c.tar.gz |
Use null check convention in preferences.c
-rw-r--r-- | src/config/preferences.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/config/preferences.c b/src/config/preferences.c index 3ca3a721..59a6a7ca 100644 --- a/src/config/preferences.c +++ b/src/config/preferences.c @@ -95,7 +95,7 @@ prefs_load(void) err = NULL; log_maxsize = g_key_file_get_integer(prefs, PREF_GROUP_LOGGING, "maxsize", &err); - if (err != NULL) { + if (err) { log_maxsize = 0; g_error_free(err); } @@ -180,7 +180,7 @@ prefs_get_string(preference_t pref) char *result = g_key_file_get_string(prefs, group, key, NULL); if (result == NULL) { - if (def != NULL) { + if (def) { return strdup(def); } else { return NULL; @@ -193,7 +193,7 @@ prefs_get_string(preference_t pref) void prefs_free_string(char *pref) { - if (pref != NULL) { + if (pref) { free(pref); } pref = NULL; @@ -419,7 +419,7 @@ prefs_get_aliases(void) char *name = keys[i]; char *value = g_key_file_get_string(prefs, PREF_GROUP_ALIAS, name, NULL); - if (value != NULL) { + if (value) { ProfAlias *alias = malloc(sizeof(struct prof_alias_t)); alias->name = strdup(name); alias->value = strdup(value); |