DentonW / DevIL

Developer's Image Library (DevIL) is a cross-platform image library utilizing a simple syntax to load, save, convert, manipulate, filter, and display a variety of images with ease. It is highly portable and has been ported to several platforms.
http://openil.sourceforge.net/
GNU Lesser General Public License v2.1
446 stars 138 forks source link

Clear the entire header in iGetFitsHead #88

Open ryandesign opened 4 years ago

ryandesign commented 4 years ago

This sets the entire header to zeroes as was intended, rather than just the first 4 or 8 bytes.

(I am assuming that there is only one element and that we don't need to multiply this by a number of elements.)

Fixes compiler warning:

src-IL/src/il_fits.cpp:105:27: warning: 'memset' call operates on objects of type 'FITSHEAD' while the size is based on a different type 'FITSHEAD *' [-Wsizeof-pointer-memaccess]
        memset(Header, 0, sizeof(Header));  // Clear the header to all 0s first.
               ~~~~~~            ^~~~~~
src-IL/src/il_fits.cpp:105:27: note: did you mean to dereference the argument to 'sizeof' (and multiply it by the number of elements)?
        memset(Header, 0, sizeof(Header));  // Clear the header to all 0s first.
                                 ^~~~~~