From: dyamy-lee Date: Mon, 26 Apr 2021 06:13:30 +0000 (+0900) Subject: Checking return value X-Git-Tag: submit/tizen/20220208.100129~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=48c3fac9bed0ab50ff77f52c3e07c5ee13d36b0a;p=platform%2Fupstream%2Flibinput.git Checking return value When using return value from other function, it is usually checked for it. Change-Id: I071942d9885500ce37adf08f89788d59d031d458 --- diff --git a/haltests/test_hal_libinput_info.cpp b/haltests/test_hal_libinput_info.cpp index b39f3dc6..5ddbe48b 100644 --- a/haltests/test_hal_libinput_info.cpp +++ b/haltests/test_hal_libinput_info.cpp @@ -29,6 +29,7 @@ int handle_device_notify(struct libinput_event *ev) struct udev_device *udev_device = libinput_device_get_udev_device(dev); enum libinput_event_type type; const char *devnode; + const char *test = NULL; errno = 0; switch(libinput_event_get_type(ev)) { @@ -42,7 +43,8 @@ int handle_device_notify(struct libinput_event *ev) abort(); } - if(strstr(udev_device_get_property_value(udev_device, "DEVPATH"), "virtual")){ + test = udev_device_get_property_value(udev_device, "DEVPATH"); + if(test && strstr(test, "virtual")){ LOG("It's contain virtual. No Check.\n"); return 0; } @@ -50,7 +52,6 @@ int handle_device_notify(struct libinput_event *ev) if (libinput_device_has_capability(dev, LIBINPUT_DEVICE_CAP_KEYBOARD)) { devnode = udev_device_get_devnode(libinput_device_get_udev_device(dev)); if(type == LIBINPUT_EVENT_DEVICE_ADDED) { // TODO. save using linked list - const char *test = NULL; test = udev_device_get_property_value(udev_device, "ID_INPUT_KEYBOARD"); LOG("devnode = %s\n", devnode); if(test && (test[0] == '1')){