Skip to content

Commit 2e821b9

Browse files
committed
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.
1 parent c3d2cf7 commit 2e821b9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

testssl.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ fileout_json_print_parameter() {
802802
spaces=" " || \
803803
spaces=" "
804804
if [[ -n "$value" ]] || [[ "$parameter" == finding ]]; then
805-
printf "%s%s%s%s" "$spaces" "\"$parameter\"" "$filler" ": \"$value\"" >> "$JSONFILE"
805+
printf -- "%b%b%b%b" "$spaces" "\"$parameter\"" "$filler" ": \"$value\"" >> "$JSONFILE"
806806
"$not_last" && printf ",\n" >> "$JSONFILE"
807807
fi
808808
}

0 commit comments

Comments
 (0)