# HG changeset patch # User Matti Hamalainen # Date 1531113160 -10800 # Node ID cf081a98dccd8d2946c798abe74357c8cd306ad2 # Parent 2f129ea15405fd90f266a2f745ded56297ff7811 Improve error output. diff -r 2f129ea15405 -r cf081a98dccd sidinfo.c --- a/sidinfo.c Mon Jul 09 08:10:50 2018 +0300 +++ b/sidinfo.c Mon Jul 09 08:12:40 2018 +0300 @@ -962,7 +962,15 @@ } -BOOL argHandleFile(char *filename) +void siError(th_ioctx *fh, const int err, const char *msg) +{ + (void) fh; + (void) err; + fprintf(stderr, "%s", msg); +} + + +BOOL argHandleFile(const char *filename) { PSIDHeader *psid = NULL; th_ioctx *inFile = NULL; @@ -980,12 +988,11 @@ goto error; } + th_io_set_handlers(inFile, siError, NULL); + // Read PSID data if (!si_read_sid_file(inFile, &psid, setSLDBNewFormat)) - { - THERR("Error reading %s\n", filename); goto error; - } // Get songlength information, if any if (sidSLDB != NULL)