diff options
Diffstat (limited to 'rts/RtsFlags.c')
-rw-r--r-- | rts/RtsFlags.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c index b51d644bdc..73635cf456 100644 --- a/rts/RtsFlags.c +++ b/rts/RtsFlags.c @@ -1559,6 +1559,10 @@ openStatsFile (char *filename, // filename, or NULL if (*filename != '\0') { /* stats file specified */ f = fopen(filename,"w"); } else { + if (filename_fmt == NULL) { + errorBelch("Invalid stats filename format (NULL)\n"); + return -1; + } /* default <program>.<ext> */ char stats_filename[STATS_FILENAME_MAXLEN]; sprintf(stats_filename, filename_fmt, prog_name); |