diff options
author | Tomasz Kramkowski <tk@the-tk.com> | 2015-07-19 14:30:31 +0200 |
---|---|---|
committer | Tomasz Kramkowski <tk@the-tk.com> | 2015-07-19 14:30:31 +0200 |
commit | 9b9a0cff925d421e029b348951dd0ca309e604d6 (patch) | |
tree | 4bacaefc31342ecb9d2332517080c505282ddc9b | |
parent | cd0fd0cacad51922b79c361a4b8943056f04cda2 (diff) | |
download | c-stuff-9b9a0cff925d421e029b348951dd0ca309e604d6.tar.gz c-stuff-9b9a0cff925d421e029b348951dd0ca309e604d6.tar.xz c-stuff-9b9a0cff925d421e029b348951dd0ca309e604d6.zip |
timer.c: Added check to see if stdout is a tty
-rw-r--r-- | timer.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -165,6 +165,9 @@ int main(int argc, char **argv) unsigned long total_seconds = 0; + if (!isatty(STDOUT_FILENO)) + error(1, 0, "Error: stdout is not a tty"); + if (argc < 2) { printf("Not enough arguments.\n"); usage(argv[0]); |