summaryrefslogtreecommitdiff
path: root/transport-helper.c
diff options
context:
space:
mode:
authorNicolas Kaiser <nikai@nikai.net>2011-03-04 23:16:26 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-03-09 05:36:12 (GMT)
commit803dbdb9686f249e88fae8530b5306d6eea62c1b (patch)
tree82393f1d452d30a5e6cf2d4cc662c2ac3968f099 /transport-helper.c
parent07873dc5dd67398324278ff0d7627bb1a863ba89 (diff)
downloadgit-803dbdb9686f249e88fae8530b5306d6eea62c1b.zip
git-803dbdb9686f249e88fae8530b5306d6eea62c1b.tar.gz
git-803dbdb9686f249e88fae8530b5306d6eea62c1b.tar.bz2
transport-helper.c: fix check for (size_t < 0)
'bytes' is of type size_t which is unsigned thus can't be negative. But the assigned write() returns ssize_t, and -1 on error. For testing < 0, 'bytes' needs to be of a signed type. Signed-off-by: Nicolas Kaiser <nikai@nikai.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'transport-helper.c')
-rw-r--r--transport-helper.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/transport-helper.c b/transport-helper.c
index 4e4754c..ba06b70 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -973,7 +973,7 @@ static int udt_do_read(struct unidirectional_transfer *t)
*/
static int udt_do_write(struct unidirectional_transfer *t)
{
- size_t bytes;
+ ssize_t bytes;
if (t->bufuse == 0)
return 0; /* Nothing to write. */