chiark / gitweb /
bus-util: replace non-printable values with [unprintable]
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 1 Jul 2017 20:49:15 +0000 (16:49 -0400)
committerSven Eden <yamakuzure@gmx.net>
Tue, 25 Jul 2017 07:46:53 +0000 (09:46 +0200)
commit460285493762467d6657e52f243d923907d19b8d
treedd02b81a3aa8e1fe2213580dfb277a91d6e94e82
parent4c98c6b0da003b18b24bab98099b4449ff475097
bus-util: replace non-printable values with [unprintable]

Like I said in the previous commit, such values do not seem to appear in normal
use, but it's pretty hard to prove that all paths to assign values properly
check that they contain no spaces. So just in case some slip through, replace
values with spaces (in case of single-valued properties) or spaces and newlines
(in case of array proprties) with "[unprintable]". We were already doing it
in case of properties which we didn't know how to print, so this fits in well.
The advantage is the previous code which used escaping that a) this is easier
to spot, b) does not mess up printing of properties which were properly escaped
already.

v2:
- add comments
src/shared/bus-util.c