Branch: refs/heads/master Author: Colomban Wendling ban@herbesfolles.org Committer: Colomban Wendling ban@herbesfolles.org Date: Thu, 02 May 2024 21:52:06 UTC Commit: a235afb4c6286a5221d12891b2ec374cbe182446 https://github.com/geany/geany-plugins/commit/a235afb4c6286a5221d12891b2ec37...
Log Message: ----------- markdown: Slightly rewrite two tests for cppcheck's sake
It's admittedly hard for a static analyzer to know that if the error pointer is non-NULL, the return value ought to be NULL; but as here the revers is also true we can simply check the value and assume the error is set.
Modified Paths: -------------- markdown/src/conf.c
Modified: markdown/src/conf.c 4 lines changed, 2 insertions(+), 2 deletions(-) =================================================================== @@ -233,7 +233,7 @@ markdown_config_get_string_key(MarkdownConfig *conf, const gchar *group, GError *error = NULL;
out_str = g_key_file_get_string(conf->priv->kf, group, key, &error); - if (error) { + if (!out_str) { g_debug("Config read failed: %s", error->message); g_error_free(error); error = NULL; out_str = g_strdup(default_value); @@ -451,7 +451,7 @@ markdown_config_save(MarkdownConfig *conf)
/*g_debug("Saving: %s\n%s", conf->priv->filename, contents);*/
- if (error) { + if (!contents) { g_warning("Error getting config data as string: %s", error->message); g_error_free(error); error = NULL; return success;
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
plugins-commits@lists.geany.org