git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Herland <johan@herland.net>
To: git@vger.kernel.org
Cc: Paolo Teti <paolo.teti@gmail.com>
Subject: [PATCH] Fix signedness on return value from xread()
Date: Tue, 15 May 2007 14:39:25 +0200	[thread overview]
Message-ID: <200705151439.25871.johan@herland.net> (raw)
In-Reply-To: <34a7ae040705150447k2e770b5ag3629632f61b813a0@mail.gmail.com>

The return value from xread() is ssize_t. 
Paolo Teti <paolo.teti@gmail.com> pointed out that in this case, the 
signed return value was assigned to an unsigned type (size_t). This patch 
fixes that.

Signed-off-by: Johan Herland <johan@herland.net>
---

Using this as an opportunity to get used to sending patches... :)

Is this what you were looking for, Paolo?

 pack-write.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pack-write.c b/pack-write.c
index de72f44..ae2e481 100644
--- a/pack-write.c
+++ b/pack-write.c
@@ -25,7 +25,7 @@ void fixup_pack_header_footer(int pack_fd,
 
 	buf = xmalloc(buf_sz);
 	for (;;) {
-		size_t n = xread(pack_fd, buf, buf_sz);
+		ssize_t n = xread(pack_fd, buf, buf_sz);
 		if (!n)
 			break;
 		if (n < 0)
-- 
1.5.1.4

  reply	other threads:[~2007-05-15 12:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-15 11:47 BUG in fixup_pack_header_footer(...) / pack-write.c checksum error never raised Paolo Teti
2007-05-15 12:39 ` Johan Herland [this message]
2007-05-15 12:48   ` [PATCH] Fix signedness on return value from xread() Paolo Teti
2007-05-15 12:49   ` [PATCH] Ensure return value from xread() is always stored into an ssize_t Johan Herland
2007-05-15 16:12     ` Dana How
2007-05-15 16:21       ` Johan Herland
2007-05-15 23:24   ` [PATCH] Fix signedness on return value from xread() Shawn O. Pearce

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=200705151439.25871.johan@herland.net \
    --to=johan@herland.net \
    --cc=git@vger.kernel.org \
    --cc=paolo.teti@gmail.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).