Module: wine Branch: master Commit: e0152e85e9acbea33591190470e78127a5825d66 URL: http://source.winehq.org/git/wine.git/?a=commit;h=e0152e85e9acbea33591190470...
Author: Vitaliy Margolen wine-patches@kievinfo.com Date: Sat Dec 27 11:23:11 2008 -0700
dinput: snprintf zero-terminates string no need to do it explicitly.
---
dlls/dinput/joystick_linuxinput.c | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/dlls/dinput/joystick_linuxinput.c b/dlls/dinput/joystick_linuxinput.c index 8df143a..95666e8 100644 --- a/dlls/dinput/joystick_linuxinput.c +++ b/dlls/dinput/joystick_linuxinput.c @@ -221,15 +221,15 @@ static void find_joydevs(void) /* Someone beat us to it */ return;
- for (i=0;i<MAX_JOYDEV;i++) { - char buf[MAX_PATH]; - struct JoyDev joydev = {0}; - int fd; - int no_ff_check = 0; - int j; - - snprintf(buf,MAX_PATH,EVDEVPREFIX"%d",i); - buf[MAX_PATH-1] = 0; + for (i = 0; i < MAX_JOYDEV; i++) + { + char buf[MAX_PATH]; + struct JoyDev joydev = {0}; + int fd; + int no_ff_check = 0; + int j; + + snprintf(buf, sizeof(buf), EVDEVPREFIX"%d", i);
if ((fd=open(buf, O_RDWR))==-1) { fd = open(buf, O_RDONLY);