cmbruns / pyopenvr

Unofficial python bindings for Valve's OpenVR virtual reality SDK
BSD 3-Clause "New" or "Revised" License
245 stars 39 forks source link

fix: error not reported from getStringTrackedDeviceProperty #63

Closed risa2000 closed 5 years ago

risa2000 commented 5 years ago

In the original code, when the call to IVRSystem::GetStringTrackedDeviceProperty failed with error (e.g. "TrackedProp_UnknownProperty") but the returned buffer size was 0, the wrapper returned empty string, instead of signalling the error.

The fix first tests for "buffer too small" condition and only after dealing with that does the regular error code check.

risa2000 commented 5 years ago

I noticed an unnecessary call to int, so I am going to recreate the patch without it.