Re: Should NetCDF character attributes be null-terminated

Mark,

In my opinion, the best thing to do is to write code that is very
conservative about what it writes into a netCDF dataset and very
liberal about what it reads. In this specific case, I wouldn't write
the terminating NUL character. On reading, however, I would check for a
terminating NUL (regardless of language) and do the appropriate thing
for the language (ensure either its presence or absence).

Nothing in the netCDF library depends on a terminating NUL.

Regards,
Steve Emmerson   <http://www.unidata.ucar.edu>

  • 2001 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: