akvcam icon indicating copy to clipboard operation
akvcam copied to clipboard

Fragile commit: Define V4L2_DEVICE_NAME_SIZE if not defined.

Open iam-TJ opened this issue 11 months ago • 1 comments

Commit 25a9094799ef 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),

iam-TJ avatar Mar 11 '24 11:03 iam-TJ

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

hipersayanX avatar Mar 11 '24 19:03 hipersayanX