[Noticed in the OpenBSD port.] $ printf "0\n0\n0\n" | ministat - - Segmentation fault (core dumped) The problem is [in ministat.c] at line 646: nds = argc; for (i = 0; i < nds; i++) { setfilenames[i] = argv[i]; if (!strcmp(argv[i], "-")) ----> setfiles[0] = stdin; else setfiles[i] = fopen(argv[i], "r"); if (setfiles[i] == NULL) err(2, "Cannot open %s", argv[i]); } The simplest fix is just to change that to: setfiles[i] = stdin; With that in place, ministat will error out reporting that (on second reading) the input has fewer than 3 data points.
Just to be clear: the issue is seen any time "-" is used as other than first data source.
DiffRev for this patch is here: https://reviews.freebsd.org/D37346