more checks of NC_ENOTBUILT
@@ -2141,20 +2141,21 @@ NC_create(const char *path0, int cmode, size_t initialsz,
#endif
/* Figure out what dispatcher to use */
+ if (model == NC_FORMATX_NC4)
#ifdef USE_NETCDF4
- if(model == (NC_FORMATX_NC4))
dispatcher = NC4_dispatch_table;
- else
-#endif /*USE_NETCDF4*/
+#else
+ return NC_ENOTBUILT;
+#endif
+ else if (model == NC_FORMATX_PNETCDF)
#ifdef USE_PNETCDF
- if(model == (NC_FORMATX_PNETCDF))
dispatcher = NCP_dispatch_table;
- else
+#else
+ return NC_ENOTBUILT;
#endif
- if(model == (NC_FORMATX_NC3))
+ else if (model == NC_FORMATX_NC3)
dispatcher = NC3_dispatch_table;
- else
- {
+ else {
nullfree(path);
return NC_ENOTNC;
}
