[geany/geany-plugins] eb2c76: Markdown: Don't hardcode filename length
Matthew Brush
git-noreply at xxxxx
Tue Feb 26 01:14:50 UTC 2013
Branch: refs/heads/master
Author: Matthew Brush <mbrush at codebrainz.ca>
Committer: Matthew Brush <mbrush at codebrainz.ca>
Date: Tue, 26 Feb 2013 01:14:50 UTC
Commit: eb2c76c5a283101ca9cb05246dd97f16b0e4c21d
https://github.com/geany/geany-plugins/commit/eb2c76c5a283101ca9cb05246dd97f16b0e4c21d
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).
More information about the Plugins-Commits
mailing list