akvcam
akvcam copied to clipboard
Fragile commit: Define V4L2_DEVICE_NAME_SIZE if not defined.
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),
Hmm, I'm usually prefer to specify the array size directly, instead of using sizeof, but ok, I can accept the change.