Skip to content

Fix sizeof array element count in find_adapters call#710

Open
heitbaum wants to merge 1 commit intoPulse-Eight:masterfrom
heitbaum:err
Open

Fix sizeof array element count in find_adapters call#710
heitbaum wants to merge 1 commit intoPulse-Eight:masterfrom
heitbaum:err

Conversation

@heitbaum
Copy link
Copy Markdown
Contributor

sizeof(devices) / sizeof(devices) always evaluated to 1, passing the wrong adapter count to find_adapters. Changed to sizeof(devices[0]) to correctly compute the number of elements.

matches intent in:

uint8_t iDevicesFound = g_parser->DetectAdapters(devices, 10, NULL, true);

sizeof(devices) / sizeof(devices) always evaluated to 1, passing the
wrong adapter count to find_adapters. Changed to sizeof(devices[0])
to correctly compute the number of elements.
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.

Compiler warning -Wsizeof-array-div

1 participant