SGL-UT / GPSTk

ATTENTION: This repository has been moved and is for archival purposes only. GPSTk toolkit has been renamed to GNSSTK and has been split into two new separate repositories. GNSSTK now only contains libraries while the other repository GNSSTK-APPS contains only applications. The rename and split into libraries and applications started with version v12.0.0 on September 2021. GPSTk --> GNSSTK at https://gitlab.com/sgl-ut/gnsstk --> GNSSTK-APPS at https://gitlab.com/sgl-ut/gnsstk-apps
Other
339 stars 182 forks source link

Assert failing in debug build for MSVC 2017 14.1 #53

Open Drazuam opened 5 years ago

Drazuam commented 5 years ago

There's an issue with FFTextStream.cpp looking at memory before it's char buffer, which is throwing an exception on debug builds in windows. Looks like it probably wouldn't be much of an issue on a "dumber" build or system that's not checking these types of things.

Simple fix though. line 157:

https://github.com/SGL-UT/GPSTk/blob/997d97d20df6aedfa018d39a8b5bfaf234368fd9/core/lib/FileHandling/FFTextStream.cpp#L157 needs to change to: while (line[0]!='\0' && *line.rbegin() == '\r')

This will cause the while to exit before it can check the rbegin() function, and it wont access memory wrongly.

Edit: I made this change and it solved the issue for me locally