From c4c9f5cf0a9af960bcc024be9b4782e61c6dcc57 Mon Sep 17 00:00:00 2001 From: Pedro Vicente Nunes Date: Thu, 29 Nov 2007 15:20:50 -0500 Subject: [svn-r14310] error check in command line: check for a wrong input of the 2 file names being the same tested: windows, linux --- tools/h5repack/h5repack_main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/h5repack/h5repack_main.c b/tools/h5repack/h5repack_main.c index 8221317..116c6cf 100644 --- a/tools/h5repack/h5repack_main.c +++ b/tools/h5repack/h5repack_main.c @@ -97,6 +97,14 @@ int main(int argc, char **argv) { infile = argv[ opt_ind ]; outfile = argv[ opt_ind + 1 ]; + + if ( strcmp( infile, outfile ) == 0 ) + { + error_msg(progname, "file names cannot be the same\n"); + usage(progname); + exit(EXIT_FAILURE); + + } } else -- cgit v0.12