1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 19:27:45 +00:00

wc: Use pledge()

This commit is contained in:
Andreas Kling 2020-02-18 11:35:36 +01:00
parent 257e7f022a
commit 7ce3f218af

View file

@ -122,6 +122,11 @@ Count get_total_count(Vector<Count>& counts)
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
if (pledge("stdio rpath", nullptr) < 0) {
perror("pledge");
return 1;
}
Vector<const char*> files; Vector<const char*> files;
Core::ArgsParser args_parser; Core::ArgsParser args_parser;
@ -140,6 +145,11 @@ int main(int argc, char** argv)
counts.append(count); counts.append(count);
} }
if (pledge("stdio", nullptr) < 0) {
perror("pledge");
return 1;
}
if (files.size() > 1) { if (files.size() > 1) {
Count total_count = get_total_count(counts); Count total_count = get_total_count(counts);
counts.append(total_count); counts.append(total_count);