From 9d74013b2a8d0968eba003b83252cfa0e5b0c13f Mon Sep 17 00:00:00 2001 From: computezrmle <57127745+computezrmle@users.noreply.github.com> Date: Thu, 3 Nov 2022 14:08:03 +0100 Subject: [PATCH] Avoid character conversion Avoid possibly unsafe character conversion 'tolower'. Instead, rely on the output of vboxmanage. Should be fine as long as the virtualbox developers keep their outputs stable. If not, all tests against their messages would need a revision. --- samples/vboxwrapper/vbox_vboxmanage.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/samples/vboxwrapper/vbox_vboxmanage.cpp b/samples/vboxwrapper/vbox_vboxmanage.cpp index 595d8451ab..4e52f8c3c4 100644 --- a/samples/vboxwrapper/vbox_vboxmanage.cpp +++ b/samples/vboxwrapper/vbox_vboxmanage.cpp @@ -605,9 +605,7 @@ namespace vboxmanage { // type_line = output; - transform(type_line.cbegin(), type_line.cend(), - type_line.begin(), [](unsigned char c) { return tolower(c); }); - type_start = type_line.find("\ntype: ") + 1; + type_start = type_line.find("\nType: ") + 1; type_end = type_line.find("\n", type_start) - type_start; type_line = type_line.substr(type_start, type_end);