mirror of
https://github.com/nsacyber/HIRS.git
synced 2025-05-02 08:43:00 +00:00
Merge pull request #413 from nsacyber/cpp-compiler-warning-fix
Cpp Compiler Warning fixes
This commit is contained in:
commit
04a66da5f3
@ -208,15 +208,18 @@ hirs::pb::OsInfo DeviceInfoCollector::collectOsInfo() {
|
|||||||
while (getline(releaseFile, line)) {
|
while (getline(releaseFile, line)) {
|
||||||
stringstream ss(line);
|
stringstream ss(line);
|
||||||
string item;
|
string item;
|
||||||
vector<string> tokens;
|
std::vector<string> tokens;
|
||||||
char* delim = const_cast<char*>("=");
|
char* delim = const_cast<char*>("=");
|
||||||
while (getline(ss, item, *delim)) {
|
while (getline(ss, item, *delim)) {
|
||||||
tokens.push_back(item);
|
tokens.push_back(item);
|
||||||
}
|
}
|
||||||
if (tokens.size() > 0 && tokens.at(0) == "ID") {
|
for (int i=0; i < tokens.size(); i++) {
|
||||||
info.set_distribution(tokens.at(1));
|
if (tokens[i] == "ID") {
|
||||||
} else if (tokens.size() > 0 && tokens.at(0) == "VERSION_ID") {
|
info.set_distribution(tokens[i+1]);
|
||||||
info.set_distributionrelease(tokens.at(1));
|
}
|
||||||
|
if (tokens[i] == "VERSION_ID") {
|
||||||
|
info.set_distributionrelease(tokens[i+1]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
releaseFile.close();
|
releaseFile.close();
|
||||||
|
@ -178,7 +178,7 @@ void printHelp() {
|
|||||||
cout << helpMessage.str() << endl;
|
cout << helpMessage.str() << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, const char** argv) {
|
||||||
string log_directory = "/var/log/hirs/provisioner";
|
string log_directory = "/var/log/hirs/provisioner";
|
||||||
|
|
||||||
// directory should be created by rpm install
|
// directory should be created by rpm install
|
||||||
|
Loading…
x
Reference in New Issue
Block a user