const char *val;
val = udev_device_get_sysattr_value(dev, key_name);
- if (val != NULL)
- util_strlcpy(value, val, sizeof(value));
+ if (val == NULL)
+ return -1;
+ util_strlcpy(value, val, sizeof(value));
}
- if (value[0] == '\0')
- return -1;
/* strip trailing whitespace of value, if not asked to match for it */
len = strlen(key_value);