From f81628eeb1edf428ce15166978a0b9a57a393560 Mon Sep 17 00:00:00 2001 From: Ed Hartnett Date: Fri, 12 Aug 2011 14:24:03 +0000 Subject: [PATCH] fixed def_var_chunking call bug --- libdispatch/dvar.c | 8 +++++--- nc_test4/tst_ar5.c | 2 +- nc_test4/tst_create_files.c | 2 +- nc_test4/tst_fills.c | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/libdispatch/dvar.c b/libdispatch/dvar.c index d342a55aa..dda7f6bf9 100644 --- a/libdispatch/dvar.c +++ b/libdispatch/dvar.c @@ -550,12 +550,14 @@ nc_def_var_fletcher32(int ncid, int varid, int fletcher32) } int -nc_def_var_chunking(int ncid, int varid, int storage, const size_t *chunksizesp) +nc_def_var_chunking(int ncid, int varid, int storage, + const size_t *chunksizesp) { NC* ncp; - int stat = NC_check_id(ncid,&ncp); + int stat = NC_check_id(ncid, &ncp); if(stat != NC_NOERR) return stat; - return ncp->dispatch->def_var_chunking(ncid,varid,storage,chunksizesp); + return ncp->dispatch->def_var_chunking(ncid, varid, storage, + chunksizesp); } int diff --git a/nc_test4/tst_ar5.c b/nc_test4/tst_ar5.c index ae50c88d7..5d97c286b 100644 --- a/nc_test4/tst_ar5.c +++ b/nc_test4/tst_ar5.c @@ -38,7 +38,7 @@ get_mem_used1(int *mem_used) system(cmd); /* Read the results and delete temp file. */ - if (!(fp = fopen(TMP_FILE_NAME, "r"))) ERR; + if (!(fp = fopen(TMP_FILE_NAME, "r"))) exit; num_char = fread(blob, MAX_LEN, 1, fp); sscanf(blob, "%d", mem_used); fclose(fp); diff --git a/nc_test4/tst_create_files.c b/nc_test4/tst_create_files.c index eb5a42602..d2494ca15 100644 --- a/nc_test4/tst_create_files.c +++ b/nc_test4/tst_create_files.c @@ -58,7 +58,7 @@ main(int argc, char **argv) if (nc_def_dim(ncid, "d1", D1, &dimids[1])) ERR; if (nc_def_dim(ncid, "d2", D2, &dimids[2])) ERR; if (nc_def_var(ncid, LARGE_VAR_NAME, NC_FLOAT, NDIMS3, dimids, &varid)) ERR; - if (nc_def_var_chunking(ncid, varid, NULL, chunk_sizes, NULL)) ERR; + if (nc_def_var_chunking(ncid, varid, NC_CHUNKED, chunk_sizes)) ERR; if (nc_enddef(ncid)) ERR; /* Write the data one slice at a time. */ diff --git a/nc_test4/tst_fills.c b/nc_test4/tst_fills.c index e76916f33..6d0a3bbb2 100644 --- a/nc_test4/tst_fills.c +++ b/nc_test4/tst_fills.c @@ -75,7 +75,7 @@ main(int argc, char **argv) if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR; /* Get the string, check it, and free it. */ - strcpy(data_in, ""); + strcpy(data_in[0], ""); if (nc_get_var_string(ncid, varid_in, data_in)) ERR; if (strcmp(data_in[0], data_out[0])) ERR; if (nc_free_string(1, data_in)) ERR;