diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2022-04-12 14:51:05 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2022-04-12 14:51:05 +0000 |
commit | 4be9fb738746bad6f98c73252518a8709b90d331 (patch) | |
tree | e9601032468bfbf0f97a3d0743c5c6b78e8360f5 /usr.bin | |
parent | 12924cec7d1149d3722bcca9474d242cd82e0af0 (diff) |
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@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/rsync/io.c | 7 |
1 files changed, 4 insertions, 3 deletions
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 <kristaps@bsd.lv> * @@ -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; } |