Commit c7a742f2 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Check argc > 1 (bug fix).

parent 4feb4832
......@@ -13,11 +13,10 @@ printAtts(int vlistID);
int main(int argc, const char **argv)
{
const char *fname = "test.nc";
// todo: handle optional arguments here to increase test coverage
const char *fname = (argc > 1) ? argv[1] : "test.nc";
int countMissingValues = 1;
/* todo: handle optional arguments here to increase test coverage */
if (argc)
fname = argv[1];
int streamID = streamOpenRead(fname);
if (streamID < 0)
......
......@@ -25,12 +25,10 @@ compute_curvilinear(double *coords_,
int main(int argc, const char **argv)
{
/* todo: handle optional arguments here to increase test coverage */
const char *fname = "test.nc";
if (argc > 1)
fname = argv[1];
int streamID = streamOpenWrite(fname, CDI_FILETYPE_NC);
// todo: handle optional arguments here to increase test coverage
const char *fname = (argc > 1) ? argv[1] : "test.nc";
int streamID = streamOpenWrite(fname, CDI_FILETYPE_NC);
if ( streamID < 0 )
{
fprintf(stderr, "Open failed on %s: %s\n", fname,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment