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>
Nicolas Kaiser committed
Mar 5, 2011 at 00:16 UTC
803dbdb9686f249e88fae8530b5306d6eea62c1b
1 file changed
+1
-1
transport-helper.c
+1
-1
@@ -973,7 +973,7 @@ static int udt_do_read(struct unidirectional_transfer *t)
973
*/
974
static int udt_do_write(struct unidirectional_transfer *t)
975
{
976
- size_t bytes;
976
+ ssize_t bytes;
977
978
if (t->bufuse == 0)
979
return 0; /* Nothing to write. */