git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/2] dir.c: fix uninitialized memory warning

From
Pat Notz <patnotz@gmail.com>
Date
Sep 16, 2010, 20:53 UTC
Message-ID
<1284670403-90716-2-git-send-email-patnotz@gmail.com>
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
Previous: Pat NotzNext: Ævar Arnfjörð Bjarmason
Message 2 of 9 in “Fix uninitialized memory read and comment typo”
  1. 0/2 Fix uninitialized memory read and comment typoPat Notz, Sep 16, 2010
  2. 1/2 dir.c: fix uninitialized memory warningPat Notz, Sep 16, 2010
  3. Ævar Arnfjörð BjarmasonSep 16, 2010
  4. Nguyen Thai Ngoc DuySep 16, 2010
  5. Pat NotzSep 17, 2010
  6. Nguyen Thai Ngoc DuySep 17, 2010
  7. Pat NotzSep 17, 2010
  8. Pat NotzSep 17, 2010
  9. 2/2 strbuf.h: fix comment typoPat Notz, Sep 16, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.