Fix incorrect format strings

This commit is contained in:
Gunnar Beutner 2017-12-13 12:48:14 +01:00
parent 96e214221d
commit 50b2d0ca72
2 changed files with 9 additions and 8 deletions

View File

@ -684,14 +684,15 @@ static int SetupService(bool install, int argc, char **argv)
return 1; return 1;
} }
printf("Service successfully installed for user '%s'\n", scmUser); std::cout << "Service successfully installed for user '" << scmUser << "'\n";
std::ofstream fuser(Utility::GetIcingaDataPath() + "\\etc\\icinga2\\user", std::ios::out | std::ios::trunc); String userFilePath = Utility::GetIcingaDataPath() + "\\etc\\icinga2\\user";
std::ofstream fuser(userFilePath.CStr(), std::ios::out | std::ios::trunc);
if (fuser) if (fuser)
fuser << scmUser; fuser << scmUser;
else else
printf("Could not write user to %s\\etc\\icinga2\\user", Utility::GetIcingaDataPath()); std::cout << "Could not write user to " << userFilePath << "\n";
fuser.close();
} }
CloseServiceHandle(schService); CloseServiceHandle(schService);

View File

@ -119,9 +119,9 @@ INT parseArguments(INT ac, WCHAR **av, po::variables_map& vm, printInfoStruct& p
wprintf( wprintf(
L"\nIt will take at least timeout times number of pings to run\n" L"\nIt will take at least timeout times number of pings to run\n"
L"Then it will output a string looking something like this:\n\n" L"Then it will output a string looking something like this:\n\n"
L"\tPING WARNING RTA: 72ms Packet loss: 20% | ping=72ms;40;80;71;77 pl=20%;20;50;0;100\n\n" L"\tPING WARNING RTA: 72ms Packet loss: 20%% | ping=72ms;40;80;71;77 pl=20%%;20;50;0;100\n\n"
L"\"PING\" being the type of the check, \"WARNING\" the returned status\n" L"\"PING\" being the type of the check, \"WARNING\" the returned status\n"
L"and \"RTA: 72ms Packet loss: 20%\" the relevant information.\n" L"and \"RTA: 72ms Packet loss: 20%%\" the relevant information.\n"
L"The performance data is found behind the \"|\", in order:\n" L"The performance data is found behind the \"|\", in order:\n"
L"returned value, warning threshold, critical threshold, minimal value and,\n" L"returned value, warning threshold, critical threshold, minimal value and,\n"
L"if applicable, the maximal value. \n\n" L"if applicable, the maximal value. \n\n"
@ -145,8 +145,8 @@ INT parseArguments(INT ac, WCHAR **av, po::variables_map& vm, printInfoStruct& p
L"Does nothing if the plugin does not accept percentages, or only uses\n" L"Does nothing if the plugin does not accept percentages, or only uses\n"
L"percentage thresholds. Ranges can be used with \"%%\", but both range values need\n" L"percentage thresholds. Ranges can be used with \"%%\", but both range values need\n"
L"to end with a percentage sign.\n\n" L"to end with a percentage sign.\n\n"
L"All of these options work with the critical threshold \"-c\" too." L"All of these options work with the critical threshold \"-c\" too.",
, progName); progName);
std::cout << '\n'; std::cout << '\n';
return 0; return 0;
} }