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

TypeHelpers: pre-callocate optionNames even if no names are provided #444

Merged
merged 1 commit into from
Dec 21, 2024

Conversation

ericek111
Copy link
Contributor

The SoapySDRArgInfo struct has an optional optionNames array. However, the client has no way of knowing whether these labels were filled by the SDR driver or are left uninitialized. Allocating and zeroing the array is more foolproof, in my opinion, and does not break the ABI.

See: #377 (comment)

@zuckschwerdt
Copy link
Member

Can you add documentation as suggested in #377 (comment)?

This prevents clients from reading junk values, as the optionNames
array is also optional.

pothosware#377 (comment)
@ericek111
Copy link
Contributor Author

Sorry, I didn't give it much thought. I've force-pushed the change.

@zuckschwerdt zuckschwerdt merged commit 309335e into pothosware:master Dec 21, 2024
41 of 47 checks passed
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.

2 participants