Skip to content

Conversation

kreijack
Copy link

@kreijack kreijack commented Mar 4, 2024

In scan_device(), the returned device name was computed wrongly. It is opened a device, then if it was found as touchscreen it is computed the name again in a different way.
It is better (and simpler) to return a strdup() of the last successfully opened device.

I suspect that in may setup I faced the bug because I have a number of entries > 9 and this create an arrangement of entries where

      snprintf(fname, sizeof(fname),
                         "%s/%s", DEV_INPUT_EVENT, namelist[i]->d_name);
      sprintf(filename, "%s/%s%d",
                         DEV_INPUT_EVENT, EVENT_DEV_NAME,
                         i);
    fname <> filename

In scan_device(), the returned device name was computed wrongly. It is
opened a device, then if it was found as touchscreen it is computed the
name again in a different way.
It is better (and simpler) to return a strdup() of  the last successfully
opened device.

Signed-off-by: Goffredo Baroncelli <kreijack@libero.it>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant