diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2014-04-06 18:23:25 +0000 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-04-10 00:08:08 +0200 |
commit | 39b2e206985d5adf99f182f9338d5267c36fea30 (patch) | |
tree | 9d4f03b89f9a6edd96513ca00b136d9b6dbb670a /input | |
parent | a20aa15969794e2a61e1273af9ffa8efea140c03 (diff) |
joystick: Fix incorrect pointer offset code.
I have some doubts that short reads are even allowed/
possible for /dev/js*, does someone know for sure?
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@37132 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'input')
-rw-r--r-- | input/joystick.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/input/joystick.c b/input/joystick.c index 680c8d6a68..e119fc37c8 100644 --- a/input/joystick.c +++ b/input/joystick.c @@ -113,7 +113,7 @@ static int mp_input_joystick_read(void *pctx, int fd) { int l=0; while((unsigned int)l < sizeof(struct js_event)) { - int r = read(fd,&ev+l,sizeof(struct js_event)-l); + int r = read(fd,((char*)&ev)+l,sizeof(struct js_event)-l); if(r <= 0) { if(errno == EINTR) continue; |