From 90d116d64103416d4435d80b931212c47d14245b Mon Sep 17 00:00:00 2001 From: Nicolas Williams Date: Sat, 27 Dec 2025 16:00:38 -0600 Subject: [PATCH] asn1: Quiet warnings --- lib/asn1/extra.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/asn1/extra.c b/lib/asn1/extra.c index 253ac5aca..d54c44e58 100644 --- a/lib/asn1/extra.c +++ b/lib/asn1/extra.c @@ -104,8 +104,9 @@ print_heim_any(const heim_any *data, int flags) r = rk_strasvis(&s2, s, VIS_CSTYLE|VIS_TAB|VIS_NL, "\""); free(s); s = NULL; - if (r > -1) - (void) asprintf(&s, "\"%s\"", s2); + if (r > -1 && asprintf(&s, "\"%s\"", s2) < 0) { + /* quiet the useless warning */ + } free(s2); return s; } @@ -154,8 +155,9 @@ print_HEIM_ANY(const heim_any *data, int flags) r = rk_strasvis(&s2, s, VIS_CSTYLE|VIS_TAB|VIS_NL, "\""); free(s); s = NULL; - if (r > -1) - (void) asprintf(&s, "\"%s\"", s2); + if (r > -1 && asprintf(&s, "\"%s\"", s2) < 0) { + /* quiet the useless warning */ + } free(s2); return s; } @@ -204,8 +206,9 @@ print_heim_any_set(const heim_any_set *data, int flags) r = rk_strasvis(&s2, s, VIS_CSTYLE|VIS_TAB|VIS_NL, "\""); free(s); s = NULL; - if (r > -1) - (void) asprintf(&s, "\"%s\"", s2); + if (r > -1 && asprintf(&s, "\"%s\"", s2) < 0) { + /* quiet the useless warning */ + } free(s2); return s; } @@ -260,8 +263,9 @@ print_HEIM_ANY_SET(const heim_any_set *data, int flags) r = rk_strasvis(&s2, s, VIS_CSTYLE|VIS_TAB|VIS_NL, "\""); free(s); s = NULL; - if (r > -1) - (void) asprintf(&s, "\"%s\"", s2); + if (r > -1 && asprintf(&s, "\"%s\"", s2) < 0) { + /* quiet the useless warning */ + } free(s2); return s; }