From b78860efdda0d5963b75b84925840c947e48609e Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 18 Dec 2018 15:22:49 +0100 Subject: make_pixelmap: Use .h5 as default output filename --- src/make_pixelmap.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/make_pixelmap.c') diff --git a/src/make_pixelmap.c b/src/make_pixelmap.c index b6e174b5..b2e95a60 100644 --- a/src/make_pixelmap.c +++ b/src/make_pixelmap.c @@ -53,7 +53,7 @@ static void show_help(const char *s) "\n" " -h, --help Display this help message.\n" "\n" -" -o, --output= Output filename. Default: pixelmap.h5.\n" +" -o, --output= Output filename. Default: .h5.\n" " --badmap Generate bad pixel map instead of geometry\n" " --good-pixel= Value for good pixels in bad map. Default 1.\n" " --bad-pixel= Value for bad pixels in bad map. Default 0.\n" @@ -240,7 +240,11 @@ int main(int argc, char *argv[]) input_file = strdup(argv[optind++]); if ( output_file == NULL ) { - output_file = strdup("pixelmap.h5"); + size_t len = strlen(input_file); + output_file = malloc(len+4); + strncpy(output_file, input_file, len-1); + strip_extension(output_file); + strcat(output_file, ".h5"); } /* Load geometry */ -- cgit v1.2.3