lib: Replace deprecated gets() with fgets() in test files - #7097
Conversation
|
Hi @petrasovaa, I would really appreciate a review on this. I am very committed to contributing high-quality code to this organization for GSoC. Could you please let me know if there are any issues I need to address? |
|
Although the update itself seems ok, I wonder if you tried to compile the file at all. It errored out for me with Clang. |
|
Hi @nilason, thanks for the review! I tested compilation with GCC and the warnings I see (incompatible pointer types, implicit function declarations in |
|
These test were removed from Makefiles in 2008, with the release of GRASS 7.8, as they were already then considered "dead code". They originate, at the latest, in the early 90's and haven't probably been used much since. So updating them to modern code is more of an exercise than of practical importance. Until someone in the team votes for removing the files, let us make it an exercise (and only replacing gets() doesn't make much sense in this situation). Below are the logs for compilation with Clang: |
|
Hi @nilason, Replaced gets() with fgets() + strcspn() to strip the newline (the main security fix) Happy to make any changes if something looks off! |
b982bcc to
d3128eb
Compare
a484cab to
adecf64
Compare
|
Thank you @nilason for the review and guidance! |
Fixes #7096