networkctl: fix uninitialized variable

We ignore the return value of sd_device_get_devtype, then devtype could
be uninitialized when used with streq_ptr. So we need to initialize it
first.
This commit is contained in:
Ronny Chevalier 2015-05-30 10:51:41 +02:00
parent 8f42ccd24b
commit 732b7f39a2

View file

@ -62,7 +62,7 @@ static int link_get_type_string(int iftype, sd_device *d, char **ret) {
assert(ret);
if (iftype == ARPHRD_ETHER && d) {
const char *devtype, *id = NULL;
const char *devtype = NULL, *id = NULL;
/* WLANs have iftype ARPHRD_ETHER, but we want
* to show a more useful type string for
* them */