- VBOX: Fix a crash bug if multiple virtual VICs are defined for a VM.

I'm not sure what the heck happened.  It probably has something to
        do with my \r removal code on Windows.  Bugs hidden by other bugs
        I suppose.

    samples/vboxwrapper/
        vbox.cpp

svn path=/trunk/boinc/; revision=24994
This commit is contained in:
Rom Walton 2012-01-04 21:59:44 +00:00
parent 449cd6a1b4
commit a6f030beb4
2 changed files with 11 additions and 2 deletions

View File

@ -180,3 +180,12 @@ Rom 4 Jan 2012
samples/vboxwrapper/ samples/vboxwrapper/
vbox.cpp vbox.cpp
Rom 4 Jan 2012
- VBOX: Fix a crash bug if multiple virtual VICs are defined for a VM.
I'm not sure what the heck happened. It probably has something to
do with my \r removal code on Windows. Bugs hidden by other bugs
I suppose.
samples/vboxwrapper/
vbox.cpp

View File

@ -1279,7 +1279,7 @@ int VBOX_VM::get_network_bytes_received(double& received) {
counter_end = output.find("\"", counter_start); counter_end = output.find("\"", counter_start);
counter_value = output.substr(counter_start, counter_end - counter_start); counter_value = output.substr(counter_start, counter_end - counter_start);
received += atof(counter_value.c_str()); received += atof(counter_value.c_str());
counter_start = output.find("\n", counter_start); counter_start = output.find("c=\"", counter_start);
} }
return 0; return 0;
@ -1315,7 +1315,7 @@ int VBOX_VM::get_network_bytes_sent(double& sent) {
counter_end = output.find("\"", counter_start); counter_end = output.find("\"", counter_start);
counter_value = output.substr(counter_start, counter_end - counter_start); counter_value = output.substr(counter_start, counter_end - counter_start);
sent += atof(counter_value.c_str()); sent += atof(counter_value.c_str());
counter_start = output.find("\n", counter_start); counter_start = output.find("c=\"", counter_start);
} }
return 0; return 0;
} }