summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorAlex Richardson <arichardson@FreeBSD.org>2020-11-04 14:31:52 +0000
committerAlex Richardson <arichardson@FreeBSD.org>2020-11-04 14:31:52 +0000
commitd24f17df969107b47af60e5ccc1ed0f1a467fc6f (patch)
tree76ed6f43d5e16ce1eeac112c9a4745087836660b /usr.sbin
parent4c18532bd0e1d70853f864abf0a03cec3ea8d288 (diff)
downloadsrc-test2-d24f17df969107b47af60e5ccc1ed0f1a467fc6f.tar.gz
src-test2-d24f17df969107b47af60e5ccc1ed0f1a467fc6f.zip
Notes
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/jls/jls.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/usr.sbin/jls/jls.c b/usr.sbin/jls/jls.c
index 4c968fdc76df..3621de849bda 100644
--- a/usr.sbin/jls/jls.c
+++ b/usr.sbin/jls/jls.c
@@ -505,17 +505,13 @@ quoted_print(int pflags, char *name, char *value)
{
int qc;
char *p = value;
- char *param_name_value;
/* An empty string needs quoting. */
if (!*p) {
- asprintf(&param_name_value, "{k:%s}{d:%s/\"\"}", name, name);
- xo_emit(param_name_value);
- free(param_name_value);
+ xo_emit("{ea:/%s}{da:/\"\"}", name, value, name);
return;
}
- asprintf(&param_name_value, "{:%s/%%s}", name);
/*
* The value will be surrounded by quotes if it contains spaces
* or quotes.
@@ -528,9 +524,7 @@ quoted_print(int pflags, char *name, char *value)
if (qc && pflags & PRINT_QUOTED)
xo_emit("{P:/%c}", qc);
- xo_emit(param_name_value, value);
-
- free(param_name_value);
+ xo_emit("{a:/%s}", name, value);
if (qc && pflags & PRINT_QUOTED)
xo_emit("{P:/%c}", qc);