Audit tty(1)
1) Be strict about number of arguments passed 2) Use a simpler logic while returning
This commit is contained in:
parent
e45297a320
commit
b9b28d4039
2
README
2
README
@ -78,7 +78,7 @@ The following tools are implemented ('*' == finished, '#' == UTF-8 support,
|
||||
=* touch yes none
|
||||
#* tr yes none
|
||||
=*| true yes none
|
||||
=* tty yes none
|
||||
=*| tty yes none
|
||||
=* uname yes none
|
||||
#* unexpand yes none
|
||||
=* uniq yes none
|
||||
|
5
tty.c
5
tty.c
@ -20,8 +20,11 @@ main(int argc, char *argv[])
|
||||
usage();
|
||||
} ARGEND;
|
||||
|
||||
if (argc)
|
||||
usage();
|
||||
|
||||
tty = ttyname(STDIN_FILENO);
|
||||
puts(tty ? tty : "not a tty");
|
||||
|
||||
return tty ? 0 : 1;
|
||||
return !tty;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user