echo: Use pledge()

This commit is contained in:
Andreas Kling 2020-02-18 10:47:23 +01:00
parent d6a1237cfe
commit 1612a1d489

View file

@ -25,9 +25,15 @@
*/
#include <stdio.h>
#include <unistd.h>
int main(int argc, char** argv)
{
if (pledge("stdio", nullptr) < 0) {
perror("pledge");
return 1;
}
for (int i = 1; i < argc; ++i) {
fputs(argv[i], stdout);
if (i != argc - 1)