From: Alexander Kuleshov <kuleshovmail@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Alexander Kuleshov <kuleshovmail@gmail.com>
Subject: [PATCH] cat-file: Move assignment to the buffer declaration
Date: Fri, 9 Jan 2015 00:20:03 +0600 [thread overview]
Message-ID: <1420741203-21107-1-git-send-email-kuleshovmail@gmail.com> (raw)
Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
---
builtin/cat-file.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/builtin/cat-file.c b/builtin/cat-file.c
index f8d8129..840ace2 100644
--- a/builtin/cat-file.c
+++ b/builtin/cat-file.c
@@ -17,14 +17,13 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name)
{
unsigned char sha1[20];
enum object_type type;
- char *buf;
+ char *buf = NULL;
unsigned long size;
struct object_context obj_context;
if (get_sha1_with_context(obj_name, 0, sha1, &obj_context))
die("Not a valid object name %s", obj_name);
- buf = NULL;
switch (opt) {
case 't':
type = sha1_object_info(sha1, NULL);
--
2.2.1.268.g1e6f5b2.dirty
next reply other threads:[~2015-01-08 18:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-08 18:20 Alexander Kuleshov [this message]
2015-01-08 19:31 ` [PATCH] cat-file: Move assignment to the buffer declaration Junio C Hamano
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=1420741203-21107-1-git-send-email-kuleshovmail@gmail.com \
--to=kuleshovmail@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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).