git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Pat Notz" <patnotz@gmail.com>
To: git@vger.kernel.org
Subject: [PATCH 1/2] dir.c: fix uninitialized memory warning
Date: Thu, 16 Sep 2010 14:53:22 -0600	[thread overview]
Message-ID: <1284670403-90716-2-git-send-email-patnotz@gmail.com> (raw)
In-Reply-To: <1284670403-90716-1-git-send-email-patnotz@gmail.com>

GCC 4.4.4 on MacOS warns about potential use of uninitialized memory.

Signed-off-by: Pat Notz <patnotz@gmail.com>
---
 dir.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dir.c b/dir.c
index 133f472..d1e5e5e 100644
--- a/dir.c
+++ b/dir.c
@@ -232,7 +232,7 @@ int add_excludes_from_file_to_list(const char *fname,
 {
 	struct stat st;
 	int fd, i;
-	size_t size;
+	size_t size = 0;
 	char *buf, *entry;
 
 	fd = open(fname, O_RDONLY);
-- 
1.7.2.3

  reply	other threads:[~2010-09-16 20:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-16 20:53 [PATCH 0/2] Fix uninitialized memory read and comment typo Pat Notz
2010-09-16 20:53 ` Pat Notz [this message]
2010-09-16 23:13   ` [PATCH 1/2] dir.c: fix uninitialized memory warning Ævar Arnfjörð Bjarmason
2010-09-16 23:26     ` Nguyen Thai Ngoc Duy
2010-09-17  0:32       ` Pat Notz
2010-09-17  1:04         ` Nguyen Thai Ngoc Duy
2010-09-17  1:13           ` Pat Notz
2010-09-17 17:23             ` Pat Notz
2010-09-16 20:53 ` [PATCH 2/2] strbuf.h: fix comment typo Pat Notz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1284670403-90716-2-git-send-email-patnotz@gmail.com \
    --to=patnotz@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).