MmgTools / mmg

open source software for bidimensional and tridimensional remeshing
http://www.mmgtools.org
Other
362 stars 117 forks source link

use fgets() results when reading .mesh files, plus language fixes #271

Closed mpotse closed 4 months ago

mpotse commented 4 months ago

The .mesh reader uses fgets() to skip comments (until end of line) but did not check the result, so it would not have noticed anything in the unlikely case of a comment line longer than MMG5_FILESTR_LGTH = 128 characters. This commit lets fgets be called repeatedly until EOL or EOF is encountered. This also avoids a compiler warning on each library. Using getline() would be easier but that is not standard C.

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 8.33333% with 11 lines in your changes are missing coverage. Please review.

Project coverage is 50.46%. Comparing base (9e391f3) to head (1ec5494).

Files Patch % Lines
src/mmg2d/inout_2d.c 0.00% 4 Missing :warning:
src/mmg3d/inout_3d.c 0.00% 4 Missing :warning:
src/mmgs/inout_s.c 25.00% 2 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #271 +/- ## =========================================== - Coverage 50.47% 50.46% -0.01% =========================================== Files 174 174 Lines 47158 47167 +9 Branches 10259 10265 +6 =========================================== Hits 23802 23802 - Misses 15633 15641 +8 - Partials 7723 7724 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Algiane commented 4 months ago

Thanks!