busctl: add and use strcmp_ptr()
authorNamhyung Kim <namhyung@gmail.com>
Fri, 31 Jul 2015 15:23:47 +0000 (00:23 +0900)
committerNamhyung Kim <namhyung@gmail.com>
Fri, 31 Jul 2015 17:16:24 +0000 (02:16 +0900)
commitc030a850ba59fbcdf796abfe48b2f220933c52c0
tree0b65fe5b4bf9695214412640deaff03f765454ec
parent10189fd6be0f547d75bc857860f3ecbbdbc447a6
busctl: add and use strcmp_ptr()

In member_compare_func(), it compares interface, type and name of
members.  But as it can contain NULL pointer, it needs to check them
before calling strcmp().  So make it as a separate strcmp_ptr
function (named after streq_ptr) so that it can be used by others.

Also let streq_ptr() to use it in order to make the code simpler.
src/basic/util.c
src/basic/util.h
src/libsystemd/sd-bus/busctl.c
src/test/test-util.c