chiark / gitweb /
sd-device: never return NULL+0
authorDavid Herrmann <dh.herrmann@gmail.com>
Wed, 15 Jul 2015 10:30:08 +0000 (12:30 +0200)
committerSven Eden <yamakuzure@gmx.net>
Tue, 14 Mar 2017 09:06:19 +0000 (10:06 +0100)
commitf6035a5ec8045bf007c7ebc5ee5306418644e7aa
tree2ed950c52167cfaf3d2663d13c0ea7175124814b
parentffd9a99e116775904762b688b2caabbc61e74c82
sd-device: never return NULL+0

It is highly confusing if a getter function returns 0, but the value is
set to NULL. This, right now, triggers assertions as code relies on the
returned values to be non-NULL.

Like with sd-bus-creds and friends, return 0 only if a value is actually
available.

Discussed with Tom, and actually fixes real bugs as in #512.
src/libelogind/sd-device/sd-device.c