dinput: snprintf zero-terminates string no need to do it explicitly.

This commit is contained in:
Vitaliy Margolen 2008-12-27 11:23:11 -07:00 committed by Alexandre Julliard
parent ae26ca6c28
commit e0152e85e9
1 changed files with 8 additions and 8 deletions

View File

@ -221,15 +221,15 @@ static void find_joydevs(void)
/* Someone beat us to it */
return;
for (i=0;i<MAX_JOYDEV;i++) {
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;
snprintf(buf, sizeof(buf), EVDEVPREFIX"%d", i);
if ((fd=open(buf, O_RDWR))==-1) {
fd = open(buf, O_RDONLY);