here my last patch for today. I got an error report "local buffer overflow..."
for our GDB implementation. The reason was a GPX file as input. So i've
changed the initial tests to prevent such errors (can be misinterpreted).
Additionally i've added some result checks for I/O ops.