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

Add missing return in BleFingerprint::fingerprintServiceAdvertisements / Fix incorrect check in hextostr() #1097

Merged
merged 2 commits into from
Nov 9, 2023

Conversation

gunnarbeutner
Copy link
Collaborator

Add missing return in BleFingerprint::fingerprintServiceAdvertisements

This isn't strictly required because setId() ignores "downgrades" to more generic ID types (i.e. from ID_TYPE_FLORA to ID_TYPE_AD in this case) but skips running unnecessary code and makes the code more readable.

Fix incorrect check in hextostr()

This function decodes hex-encoded strings (e.g. "41" -> "A"). Previously we'd check whether the output buffer's size is a multiple of two. This would incorrectly reject valid uses of the function. Instead we should check the input string's length.

This isn't _strictly_ required because setId() ignores "downgrades" to more
generic ID types (i.e. from ID_TYPE_FLORA to ID_TYPE_AD in this case) but
skips running unnecessary code and makes the code more readable.
This function decodes hex-encoded strings (e.g. "41" -> "A"). Previously we'd
check whether the output buffer's size is a multiple of two. This would
incorrectly reject valid uses of the function. Instead we should check the
input string's length.
@DTTerastar DTTerastar merged commit 4e440b2 into ESPresense:master Nov 9, 2023
5 checks passed
@DTTerastar
Copy link
Contributor

Thanks!

@gunnarbeutner gunnarbeutner deleted the minor-fixes branch November 11, 2023 18:01
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.

None yet

2 participants