diff options
author | Thomas White <taw@physics.org> | 2018-12-18 15:22:49 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2018-12-18 15:38:13 +0100 |
commit | b78860efdda0d5963b75b84925840c947e48609e (patch) | |
tree | 457d3590a26529544d2b14db3b82c9bf55db49ca /src/make_pixelmap.c | |
parent | 33d20aa3ea505e214fdcfc2c532b6bda28df7979 (diff) |
make_pixelmap: Use <input>.h5 as default output filename
Diffstat (limited to 'src/make_pixelmap.c')
-rw-r--r-- | src/make_pixelmap.c | 8 |
1 files changed, 6 insertions, 2 deletions
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=<filename> Output filename. Default: pixelmap.h5.\n" +" -o, --output=<filename> Output filename. Default: <input>.h5.\n" " --badmap Generate bad pixel map instead of geometry\n" " --good-pixel=<n> Value for good pixels in bad map. Default 1.\n" " --bad-pixel=<n> 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 */ |