freebsd-dev/lib/libc/xdr
Brooks Davis a872c37054 xdr: store chars consistently
Cast char's through unsigned char before storing as an integer in
xdr_char(), this ensures that the encoded form is consistently not
sign-extended following Open Solaris's example.

Prior to this change, platforms with signed chars would sign extend
values with the high bit set but ones with unsigned chars would not
so 0xff would be stored as 0x000000ff on unsigned char platforms and
0xffffffff on signed char platforms.  Decoding has the same
result for either form so this is a largely cosmetic change, but it
seems best to produce consistent output.

For more discussion, see https://github.com/openzfs/zfs/issues/14173

Reviewed by:	mav, imp
Differential Revision:	https://reviews.freebsd.org/D37992
2023-01-12 18:16:17 +00:00
..
Makefile.inc
Symbol.map
xdr_array.c typo: s/impelmentation/implementation/. 2020-02-07 15:14:29 +00:00
xdr_float.c
xdr_mem.c
xdr_rec.c
xdr_reference.c typo: s/impelmentation/implementation/. 2020-02-07 15:14:29 +00:00
xdr_sizeof.c
xdr_stdio.c
xdr.3
xdr.c xdr: store chars consistently 2023-01-12 18:16:17 +00:00