Skip to content

Fix classicladder warnings#3221

Merged
andypugh merged 4 commits intoLinuxCNC:masterfrom
BsAtHome:fix_classicladder_warnings
Jan 7, 2025
Merged

Fix classicladder warnings#3221
andypugh merged 4 commits intoLinuxCNC:masterfrom
BsAtHome:fix_classicladder_warnings

Conversation

@BsAtHome
Copy link
Contributor

There are several warning in the classicladder component. The ones involving string copy operations are quite serious because the used buffer sizes are wrong.

Other warning deal with missing checks on return values of fgets() and write(). The fgets() problem is solved quite easily. Fixing the return value check of write() on a serial port requires some extra code because there may be partial and restartable writes.

@smoe
Copy link
Collaborator

smoe commented Jan 7, 2025

The original code feels a bit weird. Error management anyone? But that is not ours, or is it?
I liked what I saw, but it is a memory leak, right?

@BsAtHome
Copy link
Contributor Author

BsAtHome commented Jan 7, 2025

The original code feels a bit weird. Error management anyone? But that is not ours, or is it?

That is an understatement.

If you diff the LCNC version with the current upstream, then you get a 21000+ line diff. If you try to compile the upstream version, then you get about 6000+ lines of warnings. And that includes a lot of deprecation warnings.

I liked what I saw, but it is a memory leak, right?

No memory leak identified. The malloc in question is freed a little further on.

@andypugh andypugh merged commit 21fb9b9 into LinuxCNC:master Jan 7, 2025
10 checks passed
@smoe
Copy link
Collaborator

smoe commented Jan 7, 2025

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.

3 participants