]> granicus.if.org Git - strace/commit
util: add quote_string flag signalising that string is NUL-terminated
authorEugene Syromyatnikov <evgsyr@gmail.com>
Mon, 3 Oct 2016 18:35:37 +0000 (21:35 +0300)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 3 Oct 2016 19:28:15 +0000 (19:28 +0000)
commit5cf68f97d597dba3f717070520df4f8407154b2f
tree75704e471170ab3a6cf11f734857a352d04c00bc
parent04ec08ab6271eba568665b51618ad5f21d7ee5f6
util: add quote_string flag signalising that string is NUL-terminated

It is useful in cases strings with size provided are expected to be
NUL-terminated but are not trustworthy enough to call just plain
printstr(str, -1).

* defs.h (QUOTE_OMIT_TRAILING_0): New constant definition.
* util.c (string_quote): Swallow terminating NUL if
QUOTE_OMIT_TRAILING_0 is set.
defs.h
util.c