Mercurial > hg > dmlib
comparison tools/xm2jss.c @ 2565:d56a0e86067a
Improve error handling.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 28 Feb 2022 11:49:58 +0200 |
parents | 7151597d8ec6 |
children | 9807ae37ad69 |
comparison
equal
deleted
inserted
replaced
2564:2cf4e995b50c | 2565:d56a0e86067a |
---|---|
1305 dmVerbosity = 0; | 1305 dmVerbosity = 0; |
1306 | 1306 |
1307 // Parse arguments | 1307 // Parse arguments |
1308 if (!dmArgsProcess(argc, argv, optList, optListN, | 1308 if (!dmArgsProcess(argc, argv, optList, optListN, |
1309 argHandleOpt, argHandleFile, OPTH_BAILOUT)) | 1309 argHandleOpt, argHandleFile, OPTH_BAILOUT)) |
1310 exit(1); | 1310 goto out; |
1311 | 1311 |
1312 // Check arguments | 1312 // Check arguments |
1313 if (optInFilename == NULL || optOutFilename == NULL) | 1313 if (optInFilename == NULL || optOutFilename == NULL) |
1314 { | 1314 { |
1315 argShowHelp(); | |
1315 res = dmError(DMERR_INVALID_ARGS, | 1316 res = dmError(DMERR_INVALID_ARGS, |
1316 "Input or output file not specified. Try --help.\n"); | 1317 "Input or output file not specified.\n"); |
1317 goto out; | 1318 goto out; |
1318 } | 1319 } |
1319 | 1320 |
1320 // Read the source file | 1321 // Read the source file |
1321 if ((res = dmf_open_stdio(optInFilename, "rb", &inFile)) != DMERR_OK) | 1322 if ((res = dmf_open_stdio(optInFilename, "rb", &inFile)) != DMERR_OK) |