VBOX: Initialize completion file values before parsing.

This commit is contained in:
Rom Walton 2014-09-12 11:50:22 -04:00
parent 7b2fb87689
commit 9c80adb5a1
1 changed files with 3 additions and 1 deletions

View File

@ -411,10 +411,12 @@ void extract_completion_file_info(VBOX_VM& vm, unsigned long& exit_code, string&
char path[MAXPATHLEN];
char buf[1024];
exit_code = 0;
message = "";
sprintf(path, "shared/%s", vm.completion_trigger_file.c_str());
FILE* f = fopen(path, "r");
if (f) {
message = "";
if (fgets(buf, 1024, f) != NULL) {
exit_code = atoi(buf);
}