[libgit2-glib] We need to initialize to 0 the git_buf
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgit2-glib] We need to initialize to 0 the git_buf
- Date: Sun, 22 Jun 2014 14:53:18 +0000 (UTC)
commit e6b19f80ac7162ce6c1f97f2f17fe8aba335b419
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Sun Jun 22 16:52:50 2014 +0200
We need to initialize to 0 the git_buf
libgit2-glib/ggit-config.c | 4 ++--
libgit2-glib/ggit-message.c | 2 +-
libgit2-glib/ggit-patch.c | 2 +-
libgit2-glib/ggit-repository.c | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/libgit2-glib/ggit-config.c b/libgit2-glib/ggit-config.c
index fcf3d93..9be6903 100644
--- a/libgit2-glib/ggit-config.c
+++ b/libgit2-glib/ggit-config.c
@@ -177,7 +177,7 @@ ggit_config_new_default (GError **error)
GFile *
ggit_config_find_global (void)
{
- git_buf buf;
+ git_buf buf = {0,};
GFile *path = NULL;
if (git_config_find_global (&buf) == GIT_OK)
@@ -206,7 +206,7 @@ ggit_config_find_global (void)
GFile *
ggit_config_find_system (void)
{
- git_buf buf;
+ git_buf buf = {0,};
GFile *path = NULL;
if (git_config_find_system (&buf) == GIT_OK)
diff --git a/libgit2-glib/ggit-message.c b/libgit2-glib/ggit-message.c
index 2d62a1d..4ee8ff2 100644
--- a/libgit2-glib/ggit-message.c
+++ b/libgit2-glib/ggit-message.c
@@ -40,7 +40,7 @@ ggit_message_prettify (const gchar *message,
gboolean strip_comments,
gchar comment_char)
{
- git_buf buf;
+ git_buf buf = {0,};
gchar *d;
git_buf_set(&buf, message, strlen (message));
diff --git a/libgit2-glib/ggit-patch.c b/libgit2-glib/ggit-patch.c
index e983a0f..9c14877 100644
--- a/libgit2-glib/ggit-patch.c
+++ b/libgit2-glib/ggit-patch.c
@@ -180,7 +180,7 @@ gchar *
ggit_patch_to_string (GgitPatch *patch,
GError **error)
{
- git_buf buf;
+ git_buf buf = {0,};
gchar *result = NULL;
gint ret;
diff --git a/libgit2-glib/ggit-repository.c b/libgit2-glib/ggit-repository.c
index 0aa8c63..54d2bdd 100644
--- a/libgit2-glib/ggit-repository.c
+++ b/libgit2-glib/ggit-repository.c
@@ -790,9 +790,9 @@ GFile *
ggit_repository_discover (GFile *location,
GError **error)
{
- git_buf buf;
gchar *path;
gint ret;
+ git_buf buf = {0,};
GFile *rep = NULL;
g_return_val_if_fail (G_IS_FILE (location), NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]