[pve-devel] [PATCH common] print defaulttxt as sprintf parameter

Dominik Csapak d.csapak at proxmox.com
Thu Jun 6 11:03:56 CEST 2019


instead of having it verbatim in the format string.
This enables us to have '%' in the defaulttext without getting errors

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 src/PVE/RESTHandler.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/RESTHandler.pm b/src/PVE/RESTHandler.pm
index 49d43b9..75d5d2e 100644
--- a/src/PVE/RESTHandler.pm
+++ b/src/PVE/RESTHandler.pm
@@ -538,7 +538,7 @@ my $get_property_description = sub {
 	    die "unknown style '$style'";
 	}
 
-	my $tmp = sprintf "  %-10s %s$defaulttxt\n", $display_name, "$type_text";
+	my $tmp = sprintf "  %-10s %s%s\n", $display_name, "$type_text", "$defaulttxt";
 	my $indend = "             ";
 
 	$res .= Text::Wrap::wrap('', $indend, ($tmp));
-- 
2.11.0





More information about the pve-devel mailing list