[PATCH] Fix signedness on return value from xread()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The return value from xread() is ssize_t. 
Paolo Teti <paolo.teti@xxxxxxxxx> 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@xxxxxxxxxxx>
---

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
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux