Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return the correct name during a device scan #222

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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 <[email protected]>
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