From e8120de2e70de2c2bae79b611be689994e2de7df Mon Sep 17 00:00:00 2001 From: David Phillips Date: Fri, 11 Mar 2016 17:12:11 +1300 Subject: Remove disgusting EXIT_SUCCESS and EXIT_FAILURE swarf --- misc.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'misc.c') diff --git a/misc.c b/misc.c index eb48628..5b9e773 100644 --- a/misc.c +++ b/misc.c @@ -37,15 +37,13 @@ double get_sec() /* EOF means this is the last track; return invalid time */ if (items == EOF) - { - return -1.f; - } + return -1; if (items != 3) { /* FIXME doesn't explicitly close fin from cue-bin-split.c upon exit() */ fprintf(stderr, "Timestamp malformed\n"); - exit(EXIT_FAILURE); + exit(-1); } return SEC_FROM_TS(mm, ss, ff); } @@ -53,14 +51,14 @@ double get_sec() /* Constructs an output filename in the specified buffer based on the given format and track number * Main purpose is to catch buffer overflow with snprintf */ -void construct_out_name(char *buffer, size_t buffer_size, char* format, unsigned int track) +int construct_out_name(char *buffer, size_t buffer_size, char* format, unsigned int track) { if (snprintf(buffer, buffer_size, format, track) == buffer_size) { fprintf(stderr, "Filename too large for buffer (max %zd)\n", buffer_size); - return EXIT_FAILURE; + return -1; } - return EXIT_SUCCESS; + return 0; } /* Displays the help/syntax message and dies @@ -77,5 +75,5 @@ void die_help() " -s size of a single channel's sample (bytes)\n" " -f name_format (%%d and co are replaced with track number)\n" ); - exit(EXIT_FAILURE); + exit(-1); } -- cgit v1.1