Fix trr magic number reading
commitf7d4d019eecd733a56cbf4eeb9c936c6bd775eb1
authorMark Abraham <mark.j.abraham@gmail.com>
Tue, 12 Jul 2016 13:55:46 +0000 (12 15:55 +0200)
committerMark Abraham <mark.j.abraham@gmail.com>
Tue, 12 Jul 2016 14:09:13 +0000 (12 16:09 +0200)
tree973858e50e4be6be2e0598683d5c486094bd9663
parentd714741d1576ae78aaa2ea1a8a46e73094ec03e2
Fix trr magic number reading

The trr header-reading routine returned an "OK" value if the magic
number was wrong, which might lead to chaotic results everywhere,
because checking of return values tends not to happen (even when
they're right). Other GROMACS magic-number reading routines tend to
give a fatal error if the the number is wrong, e.g. by reading a file
written in wrong endianness. (This should never be a thing for XDR
files, which are defined to be big endian, but such code has existed.)

This change adds/restores that behaviour to trr reading, along
with separating the behaviour of failing to read a magic integer
from reading one that doesn't match.

Fixes #1926

Change-Id: I3cdd8ae9172e3b95fc232d8fa31a442d239233db
src/gromacs/fileio/trrio.cpp