From: claudio Date: Tue, 12 Apr 2022 14:51:04 +0000 (+0000) Subject: Do not convert the int value twice from little to host endian. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=40f749700c430a94f03af1996a694cc697302f27;p=openbsd Do not convert the int value twice from little to host endian. io_read_int() already does the conversion so don't double up in io_read_ulong(). Fixes openrsync on sparc64. OK miod@ deraadt@ --- diff --git a/usr.bin/rsync/io.c b/usr.bin/rsync/io.c index 87019a9567a..6dac7228ec7 100644 --- a/usr.bin/rsync/io.c +++ b/usr.bin/rsync/io.c @@ -1,4 +1,4 @@ -/* $OpenBSD: io.c,v 1.21 2021/12/28 11:59:48 claudio Exp $ */ +/* $OpenBSD: io.c,v 1.22 2022/04/12 14:51:04 claudio Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * @@ -585,8 +585,9 @@ io_read_ulong(struct sess *sess, int fd, uint64_t *val) if (!io_read_int(sess, fd, &sval)) { ERRX1("io_read_int"); return 0; - } else if (sval != -1) { - *val = (uint64_t)le32toh(sval); + } + if (sval != -1) { + *val = sval; return 1; }