diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/dw-hdfsee.c | 13 | ||||
-rw-r--r-- | src/make_pixelmap.c | 8 |
2 files changed, 6 insertions, 15 deletions
diff --git a/src/dw-hdfsee.c b/src/dw-hdfsee.c index 7545e4ab..76caaefd 100644 --- a/src/dw-hdfsee.c +++ b/src/dw-hdfsee.c @@ -1703,19 +1703,6 @@ static gint displaywindow_save_response(GtkWidget *d, gint response, } -static void strip_extension(char *bfn) -{ - size_t r = strlen(bfn)-1; - while ( r > 0 ) { - if ( bfn[r] == '.') { - bfn[r] = '\0'; - return; - } - r--; - } -} - - static void move_back_one(char *a) { int i; 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 */ |