getrandom: print string as hex-escaped
authorEugene Syromyatnikov <evgsyr@gmail.com>
Fri, 6 Jan 2017 08:57:42 +0000 (09:57 +0100)
committerDmitry V. Levin <ldv@altlinux.org>
Fri, 6 Jan 2017 11:43:50 +0000 (11:43 +0000)
commitc119a6da7c375773ff434fa1a6c8f7c070f40c43
tree5058c3926b3179fb658c7d8710dd8ee12ab7a812
parent34a920baadf2786773e6b6aecf7e2476bb0ac216
getrandom: print string as hex-escaped

Since there is no reason to interpret the value returned by getrandom as
ASCII string, it makes sense to always print it as a hex-escaped string.

* getrandom.c (SYS_FUNC(getrandom)): Use printstr_ex instead
of printstrn, set QUOTE_FORCE_HEX in user_style parameter in order
to force hex-escaped string formatting.
* tests/getrandom.test: Remove no longer needed -xx flag as the string
is always printed in hexadecimal format now.

Suggested-by: JingPiao Chen <chenjingpiao@gmail.com>
getrandom.c
tests/getrandom.test