monome / libmonome

makes writing applications for Monomes easy.
ISC License
302 stars 158 forks source link

Linux sysfs: Check asprintf() return value #56

Closed simonvanderveldt closed 6 years ago

simonvanderveldt commented 6 years ago

Fixes #50

Even though it's not a big change please review thoroughly, I have pretty much zero C experience. Also not sure about the label name, I used err_asprintf couldn't come up with a better name :x

Are there any tests I can run to validate the code?

P.S. The travis build test doesn't actually build this code since the builder has udev available. I have an additional commit that adds a --disable-udev flag to ./waf configure that allows one to explicitly disable udev. That can also be used to test this code. Shall I add it to this PR or create a separate one for that?