diff options
author | Sylvain Henry <hsyl20@gmail.com> | 2017-06-18 16:50:09 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-06-19 08:15:44 -0400 |
commit | bea18a0e9ea5ff2063ca4900acad9995f40276eb (patch) | |
tree | 1c74be65cc9c52fdad5ca3daa5cd80ea62557e27 /rts/RtsFlags.c | |
parent | 23f47b15bd45ead7ba50dce276162bb019822e7c (diff) | |
download | haskell-bea18a0e9ea5ff2063ca4900acad9995f40276eb.tar.gz |
Fix GCC 7 warning in the RTS
Test Plan: validate
Reviewers: austin, bgamari, erikd, simonmar
Reviewed By: bgamari, simonmar
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3648
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); |