From 899e97f2730db331e3bce41c29f09d5f31164463 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 8 Jan 2021 22:20:26 -0800 Subject: [PATCH] pspp-output: Don't write binary data to a terminal for dump-legacy-data. --- utilities/pspp-output.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utilities/pspp-output.c b/utilities/pspp-output.c index 6fdf48918a..d918496e8d 100644 --- a/utilities/pspp-output.c +++ b/utilities/pspp-output.c @@ -513,6 +513,9 @@ run_dump_legacy_data (int argc UNUSED, char **argv) if (err) error (1, 0, "%s", err); + if (raw && isatty (STDOUT_FILENO)) + error (1, 0, "not writing binary data to tty"); + struct spv_item **items; size_t n_items; spv_select (spv, criteria, n_criteria, &items, &n_items); -- 2.30.2