rogersce / cnpy

library to read/write .npy and .npz files in C/C++
MIT License
1.34k stars 301 forks source link

Assertion littleEndian triggered by single-byte datatypes #1

Closed damiendr closed 11 years ago

damiendr commented 12 years ago

Single-byte datatypes such as np.byte have '|' as their byte order character. This wrongly triggers an assertion failure in cnpy.cpp, line 88

Suggested fix:

bool littleEndian = ((header[loc1] == '<' || header[loc1] == '|') ? true : false); assert(littleEndian);