README example: prevent segmentation fault and mixture of printf/wprintf #470
No reviewers
Labels
No labels
3rdparty
Android
API
Author does not respond
bsd
bug
build system/CI
ci-virtual-device
CMake
Contributions Welcome
Core
dependencies
device-specific
documentation
don't_merge
duplicate
enhancement
Example
Haiku
hidraw
hotplug
info required
invalid
libusb
macOS
Misc
Not an issue
question
Release
Test
Test GUI
Windows
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-libusb/hidapi!470
Loading…
Reference in a new issue
No description provided.
Delete branch "example_changes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When no device is connected (or user doesn't have permission to access
device), hid_open returns NULL. If NULL is passed to
hid_get_manufacturer_string(), it crashes with SIGSEGV, which could be
confusing to newcomers trying to get example to work.
wprintf and printf aren't compatible in the same stream
Now it's more similar to https://github.com/libusb/hidapi/blob/master/hidtest/test.c#L129
Closes: #469
@ -117,22 +117,28 @@ int main(int argc, char* argv[])// Open the device using the VID, PID,@ -117,22 +117,28 @@ int main(int argc, char* argv[])// Open the device using the VID, PID,Good point, but make the same change in the other test.c 😁