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

Fragile commit: Define V4L2_DEVICE_NAME_SIZE if not defined. #83

Open
iam-TJ opened this issue Mar 11, 2024 · 1 comment
Open

Fragile commit: Define V4L2_DEVICE_NAME_SIZE if not defined. #83

iam-TJ opened this issue Mar 11, 2024 · 1 comment

Comments

@iam-TJ
Copy link

iam-TJ commented Mar 11, 2024

Commit 25a9094 adds a preprocessor definition in response to upstream commit 06016a67c616 that specifically calls out this approach as bad:

"Don't use defines for the size of a name field, everyone should just use sizeof(). In this case it was never used, but it is bad practice, so just drop it."

The correct fix should be:

-             V4L2_DEVICE_NAME_SIZE,
+             sizeof(self->v4l2_dev.name),
@hipersayanX
Copy link
Member

Hmm, I'm usually prefer to specify the array size directly, instead of using sizeof, but ok, I can accept the change.

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

No branches or pull requests

2 participants