aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--toys/other/stat.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/toys/other/stat.c b/toys/other/stat.c
index d828534c..22b1b833 100644
--- a/toys/other/stat.c
+++ b/toys/other/stat.c
@@ -198,6 +198,7 @@ void stat_main(void)
if (*f != '%') putchar(*f);
else {
f = next_printf(f, &TT.pattern);
+ if (!f) error_exit("bad -c \"%s\"", format);
TT.patlen = f-TT.pattern;
if (TT.patlen>99) error_exit("bad %s", TT.pattern);
if (*f == 'n') strout(TT.file);