Fix invalid JSON when certificate issuer contains non-ASCII chars (3.0)

Changed printf %s to printf %b which cause now to output UTF-8 correctly.

See #1992.
This commit is contained in:
Dirk 2021-10-03 18:31:06 +02:00
parent c3d2cf75b4
commit 2e821b9f62

View File

@ -802,7 +802,7 @@ fileout_json_print_parameter() {
spaces=" " || \
spaces=" "
if [[ -n "$value" ]] || [[ "$parameter" == finding ]]; then
printf "%s%s%s%s" "$spaces" "\"$parameter\"" "$filler" ": \"$value\"" >> "$JSONFILE"
printf -- "%b%b%b%b" "$spaces" "\"$parameter\"" "$filler" ": \"$value\"" >> "$JSONFILE"
"$not_last" && printf ",\n" >> "$JSONFILE"
fi
}