From 614b3a5914ae7c3f3e020e206eda4da13da4e2c3 Mon Sep 17 00:00:00 2001 From: Nicolas Williams Date: Sat, 27 Mar 2021 22:46:28 -0500 Subject: [PATCH] asn1: Fix OS X build We can't use VIS_DQ on when the OS has a vis implementation but lacks VIS_DQ. --- lib/asn1/extra.c | 8 ++++---- lib/asn1/gen_template.c | 2 +- lib/asn1/template.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/asn1/extra.c b/lib/asn1/extra.c index e6bc9211d..5aac18782 100644 --- a/lib/asn1/extra.c +++ b/lib/asn1/extra.c @@ -99,7 +99,7 @@ print_heim_any(const heim_any *data) int r = -1; if (s) - r = rk_strasvis(&s2, s, VIS_CSTYLE|VIS_TAB|VIS_NL|VIS_DQ, ""); + r = rk_strasvis(&s2, s, VIS_CSTYLE|VIS_TAB|VIS_NL, "\""); free(s); s = NULL; if (r > -1) @@ -148,7 +148,7 @@ print_HEIM_ANY(const heim_any *data) int r = -1; if (s) - r = rk_strasvis(&s2, s, VIS_CSTYLE|VIS_TAB|VIS_NL|VIS_DQ, ""); + r = rk_strasvis(&s2, s, VIS_CSTYLE|VIS_TAB|VIS_NL, "\""); free(s); s = NULL; if (r > -1) @@ -197,7 +197,7 @@ print_heim_any_set(const heim_any_set *data) int r = -1; if (s) - r = rk_strasvis(&s2, s, VIS_CSTYLE|VIS_TAB|VIS_NL|VIS_DQ, ""); + r = rk_strasvis(&s2, s, VIS_CSTYLE|VIS_TAB|VIS_NL, "\""); free(s); s = NULL; if (r > -1) @@ -252,7 +252,7 @@ print_HEIM_ANY_SET(const heim_any_set *data) int r = -1; if (s) - r = rk_strasvis(&s2, s, VIS_CSTYLE|VIS_TAB|VIS_NL|VIS_DQ, ""); + r = rk_strasvis(&s2, s, VIS_CSTYLE|VIS_TAB|VIS_NL, "\""); free(s); s = NULL; if (r > -1) diff --git a/lib/asn1/gen_template.c b/lib/asn1/gen_template.c index 50a5ce5e4..87e0ce60b 100644 --- a/lib/asn1/gen_template.c +++ b/lib/asn1/gen_template.c @@ -592,7 +592,7 @@ defval(struct templatehead *temp, Member *m) char *quoted; if (rk_strasvis("ed, m->defval->u.stringvalue, - VIS_CSTYLE | VIS_DQ | VIS_NL, "") < 0) + VIS_CSTYLE | VIS_NL, "\"") < 0) err(1, "Could not quote a string"); add_line(temp, "{ A1_OP_DEFVAL|A1_DV_UTF8STRING, ~0, (void *)\"%s\" }", quoted); diff --git a/lib/asn1/template.c b/lib/asn1/template.c index 85a370d6b..78881648b 100644 --- a/lib/asn1/template.c +++ b/lib/asn1/template.c @@ -2625,7 +2625,7 @@ _asn1_print(const struct asn1_template *t, char *s2 = NULL; if (s) - (void) rk_strasvis(&s2, s, VIS_CSTYLE|VIS_TAB|VIS_NL|VIS_DQ, ""); + (void) rk_strasvis(&s2, s, VIS_CSTYLE|VIS_TAB|VIS_NL, "\""); free(s); s = s2; if (s)