config: fix assertion failure on <touch><deviceName>

When <touch><deviceName> is expressed as a child node rather than an
attribute, `content` in `fill_touch()` becomes NULL when the parser
reaches <deviceName>.
This commit is contained in:
tokyo4j 2024-08-18 12:18:41 +09:00
parent b667107d1a
commit a0a9f977b4

View file

@ -545,7 +545,12 @@ fill_touch(char *nodename, char *content)
if (!strcasecmp(nodename, "touch")) {
current_touch = znew(*current_touch);
wl_list_append(&rc.touch_configs, &current_touch->link);
} else if (!strcasecmp(nodename, "deviceName.touch")) {
return;
} else if (!content) {
return;
}
if (!strcasecmp(nodename, "deviceName.touch")) {
current_touch->device_name = xstrdup(content);
} else if (!strcasecmp(nodename, "mapToOutput.touch")) {
current_touch->output_name = xstrdup(content);