Cleanups and fixes - #14
Open
3x380V wants to merge 15 commits into
Open
Conversation
pkot
reviewed
Jul 27, 2026
pkot
reviewed
Jul 27, 2026
| memcpy(data->locks_info[1].data, tmp + 16, 4); | ||
| memcpy(data->locks_info[2].data, tmp + 20, 4); | ||
| memcpy(data->locks_info[3].data, tmp + 5, 10); | ||
|
|
Contributor
Author
There was a problem hiding this comment.
How? Destination is already zeroed and tmp is hexdump.
pkot
reviewed
Jul 27, 2026
pkot
reviewed
Jul 27, 2026
pkot
reviewed
Jul 27, 2026
pkot
reviewed
Jul 27, 2026
pkot
reviewed
Jul 27, 2026
| phoneMonitor.call.callInProgress = CS_Waiting; | ||
| strncpy (phoneMonitor.call.callNum, call->remote_number, INCALL_NUMBER_LENGTH); | ||
| strncpy (phoneMonitor.call.callNum, call->remote_number, INCALL_NUMBER_LENGTH - 1); | ||
| phoneMonitor.call.callNum[INCALL_NUMBER_LENGTH - 1] = 0; |
Contributor
Author
There was a problem hiding this comment.
This one is not same as above, call->remote_number is a bounded 49-char field, so snprintf into callNum[20] produces a new -Wformat-truncation warning.
pkot
approved these changes
Jul 27, 2026
3x380V
marked this pull request as draft
July 27, 2026 21:00
3x380V
marked this pull request as ready for review
July 27, 2026 21:28
- fix calculation of remaining space in the destination for strncat - use sizeof to get size of buffer - refactor first and last name concatenation
As locks_info fields are already zeroed use memcpy to transfer fixed-width hex digits there. It is a bit more efficient and fixes stringop-truncation warning.
Fixes stringop-truncation warning.
Also fixes format-truncation warning.
Let all serial_open() errors go through a single bail path, so the instance_data allocated by serial_init() is released on every failure path.
Let all irda_open() errors go through a single bail path, so the WSACleanup is called on every relevant failure path.
The changespeed device operation is expected to return gn_error, so propagate the serial_changespeed() result instead of discarding it. Wire DTR/RTS handling.
Register a getfd method and query it on demand, which allows to drop the cached fd from gn_device. Backends with no file descriptor to offer leave the method unset and device_getfd() returns -1 for them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix some GCC warnings (mostly low hanging fruits) and add some actual fixes.