diff options
author | Mattias Andrée <maandree@kth.se> | 2020-05-01 23:55:12 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2020-05-01 23:55:22 +0200 |
commit | b5d8900b6baa5b8b840589f4ede6724b3dfa6247 (patch) | |
tree | 78734ba3fe10b618f55338645988863e66b60d83 | |
parent | m (diff) | |
download | libskrift-b5d8900b6baa5b8b840589f4ede6724b3dfa6247.tar.gz libskrift-b5d8900b6baa5b8b840589f4ede6724b3dfa6247.tar.bz2 libskrift-b5d8900b6baa5b8b840589f4ede6724b3dfa6247.tar.xz |
demo: refuse to write image to terminal
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r-- | demo.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -3,6 +3,7 @@ #include <stdlib.h> #include <string.h> +#include <unistd.h> int main(void) @@ -15,6 +16,11 @@ main(void) double height; size_t size, i; + if (isatty(STDOUT_FILENO)) { + fprintf(stderr, "Output file is a binary PAM image file, I am not writing that to a terminal.\n"); + return 1; + } + rendering.smoothing = LIBSKRIFT_SUBPIXEL; rendering.subpixel_order = LIBSKRIFT_NONE; rendering.flags = LIBSKRIFT_MIRROR_CHARS | LIBSKRIFT_MIRROR_TEXT; |