Skip to content

Commit 9d74013

Browse files
authored
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.
1 parent 213028b commit 9d74013

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

samples/vboxwrapper/vbox_vboxmanage.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -605,9 +605,7 @@ namespace vboxmanage {
605605
//
606606

607607
type_line = output;
608-
transform(type_line.cbegin(), type_line.cend(),
609-
type_line.begin(), [](unsigned char c) { return tolower(c); });
610-
type_start = type_line.find("\ntype: ") + 1;
608+
type_start = type_line.find("\nType: ") + 1;
611609
type_end = type_line.find("\n", type_start) - type_start;
612610
type_line = type_line.substr(type_start, type_end);
613611

0 commit comments

Comments
 (0)