Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve cross-platform compatibility for Euroc dataset file reading #53

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Jas0nG
Copy link

@Jas0nG Jas0nG commented Sep 24, 2024

This PR addresses a cross-platform compatibility issue in the dataset file reading logic. The previous implementation used '\r\n' format specifiers for fscanf based on the platform, which could lead to incorrect results on non-Windows systems.

Changes:

Conditional compilation: The code now uses #ifdef _WIN32 to conditionally compile the fscanf format specifier based on the platform.
Windows-specific format: For Windows platforms, the format specifier %2047[^\r]\r\n is used, which matches up to 2047 non-carriage return characters followed by a carriage return and newline sequence.
Linux-specific format: For non-Windows platforms, the format specifier %2047[^\n]\n is used, which matches up to 2047 non-newline characters followed by a newline character.
Benefits:

Improved cross-platform compatibility: The code now works correctly on both Windows and Linux systems.
Enhanced robustness: The code is less likely to fail due to platform-specific differences in newline characters.
Testing:

Tested on Ubuntu 20.04 LTS

By making this change, we can ensure that our code can handle dataset file correctly on a wider range of platforms.

JasonG

@CLAassistant
Copy link

CLAassistant commented Sep 24, 2024

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants