From 048930cb832d0a9774c614a5b2fa6e3c54a79dc5 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Tue, 26 Apr 2016 16:21:43 +1200 Subject: Exit with failure if filename construction fails --- cue-bin-split.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cue-bin-split.c b/cue-bin-split.c index 2e2a190..5bd4f3d 100644 --- a/cue-bin-split.c +++ b/cue-bin-split.c @@ -118,7 +118,11 @@ int main(int argc, char **argv) while ( finish_sample != ULONG_MAX ) { track++; - construct_out_name(out_fname, sizeof(out_fname), format, track); + if (construct_out_name(out_fname, sizeof(out_fname), format, track) < 0) + { + fclose(fin); + return 1; + } finish_sec = get_sec(); printf("%s starts %f s, finishes ", out_fname, start_sec); -- cgit v1.1