Modified behavior when an unknown error is handled by libpnetcdf.

This commit is contained in:
Ward Fisher 2015-10-28 16:44:54 -06:00
parent b7746cf89b
commit ee9a68e931

View File

@ -260,7 +260,12 @@ const char *nc_strerror(int ncerr1)
return "NetCDF: Error in using diskless access";
default:
#ifdef USE_PNETCDF
return ncmpi_strerror(ncerr1);
/* The behavior of ncmpi_strerror here is to return
NULL, not a string. This causes problems in (at least)
the fortran interface. */
return (ncmpi_strerror(ncerr1) ?
ncmpi_strerror(ncerr1) :
"Unknown Error");
#else
return "Unknown Error";
#endif