Branch: refs/heads/master Author: Matthew Brush mbrush@codebrainz.ca Committer: Matthew Brush mbrush@codebrainz.ca Date: Tue, 26 Feb 2013 01:14:50 UTC Commit: eb2c76c5a283101ca9cb05246dd97f16b0e4c21d https://github.com/geany/geany-plugins/commit/eb2c76c5a283101ca9cb05246dd97f...
Log Message: ----------- Markdown: Don't hardcode filename length
Fixes warning about PATH_MAX and is better anyway.
Modified Paths: -------------- markdown/src/conf.c
Modified: markdown/src/conf.c 5 files changed, 3 insertions(+), 2 deletions(-) =================================================================== @@ -81,7 +81,7 @@ enum
struct _MarkdownConfigPrivate { - gchar filename[PATH_MAX]; + gchar *filename; GKeyFile *kf; guint handle; gulong dlg_handle; @@ -401,6 +401,7 @@ static gboolean on_idle_timeout(MarkdownConfig *conf) markdown_config_save(self); }
+ g_free(self->priv->filename); g_key_file_free(self->priv->kf);
G_OBJECT_CLASS(markdown_config_parent_class)->finalize (object); @@ -422,7 +423,7 @@ static gboolean on_idle_timeout(MarkdownConfig *conf)
g_return_val_if_fail(filename, conf);
- strncpy(conf->priv->filename, filename, PATH_MAX); + conf->priv->filename = g_strdup(filename); init_conf_file(conf); conf->priv->kf = g_key_file_new(); if (!g_key_file_load_from_file(conf->priv->kf, conf->priv->filename,
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).