summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2018-10-19 19:53:18 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2018-10-19 19:53:18 (GMT)
commit9838dba4a402f0d6375fc6aba405ff74a5c73db8 (patch)
treef57dba8a2dfdbaef23d0bf4dd19e8b14d491b04a /tools
parentcce1727525ac395e87c85e89d7a60ad4acd9a1cb (diff)
downloadhdf5-9838dba4a402f0d6375fc6aba405ff74a5c73db8.zip
hdf5-9838dba4a402f0d6375fc6aba405ff74a5c73db8.tar.gz
hdf5-9838dba4a402f0d6375fc6aba405ff74a5c73db8.tar.bz2
TRILAB-81 Output error if filename length is greater then 255
Diffstat (limited to 'tools')
-rw-r--r--tools/src/h5import/h5import.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c
index ea40322..42ce317 100644
--- a/tools/src/h5import/h5import.c
+++ b/tools/src/h5import/h5import.c
@@ -88,6 +88,7 @@ int main(int argc, char *argv[])
const char *err7 = "Invalid type of data - %s.\n";
const char *err8 = "Invalid size of data - %s.\n";
const char *err9 = "Cannot specify more than 30 input files in one call to h5import.\n";
+ const char *err10 = "Length of output file name limited to 255 chars.\n";
h5tools_setprogname(PROGRAMNAME);
h5tools_setstatus(EXIT_SUCCESS);
@@ -155,6 +156,10 @@ int main(int argc, char *argv[])
break;
case 5: /* get outfile found */
+ if (HDstrlen(argv[i]) > 255) {
+ (void) HDfprintf(stderr, err10, argv[i]);
+ goto err;
+ }
(void) HDstrcpy(opt.outfile, argv[i]);
outfile_named = TRUE;
break;