peek(1) #93

Closed
trinity wants to merge 25 commits from peek into main
Showing only changes of commit 4dc1900339 - Show all commits

View File

@ -22,7 +22,8 @@
#include <stdlib.h> /* exit(3), EXIT_FAILURE */
#include <sysexits.h> /* EX_IOERR, EX_OK, EX_USAGE */
#include <termios.h> /* tcgetattr(3), tcsetattr(3), struct termios, ECHO */
#include <unistd.h> /* getopt(3), isatty(3), STDIN_FILENO */
#include <unistd.h> /* getopt(3), isatty(3), pledge(2), unveil(2),
* STDIN_FILENO */
char *program_name = "peek";
@ -60,6 +61,11 @@ usage(char *argv0) {
}
int main(int argc, char *argv[]){
#ifdef __OpenBSD__
pledge("stdio tty unveil", NULL);
unveil(NULL, NULL);
#endif
trinity marked this conversation as resolved Outdated
Outdated
Review

Remember to handle the possible errors here!

Remember to handle the possible errors here!
if (argc > 0) { /* option parsing */
char allow_nonterminals;
int c;