TRILAB-81 Output error if filename length is greater then 255

This commit is contained in:
Allen Byrne 2018-10-19 14:53:18 -05:00
parent cce1727525
commit 9838dba4a4

View File

@ -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;