VirtualBox

Changeset 54084 in vbox


Ignore:
Timestamp:
Feb 5, 2015 1:59:30 PM (10 years ago)
Author:
vboxsync
Message:

Additions/x11: fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/x11/vboxvideo/getmode.c

    r54054 r54084  
    496496        {
    497497#define BITS_PER_BLOCK (sizeof(unsigned long) * 8)
    498             char pszFile[64] = "/dev/input/";
    499             char pszDevice[64] = "";
     498            char szFile[64] = "/dev/input/";
     499            char szDevice[64] = "";
    500500            unsigned long afKeys[KEY_MAX / BITS_PER_BLOCK];
    501501
    502             strncat(pszFile, pDirent->d_name, sizeof(pszFile));
     502            strncat(szFile, pDirent->d_name, sizeof(szFile) - sizeof("/dev/input/"));
    503503            if (fd != -1)
    504504                close(fd);
    505             fd = open(pszFile, O_RDONLY | O_NONBLOCK);
     505            fd = open(szFile, O_RDONLY | O_NONBLOCK);
    506506            if (   fd == -1
    507                 || ioctl(fd, EVIOCGNAME(sizeof(pszDevice)), pszDevice) == -1
    508                 || strcmp(pszDevice, "Video Bus") != 0)
     507                || ioctl(fd, EVIOCGNAME(sizeof(szDevice)), szDevice) == -1
     508                || strcmp(szDevice, "Video Bus") != 0)
    509509                continue;
    510510            if (   ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(afKeys)), afKeys) == -1
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette