diff --git a/src/joystick/os2/SDL_os2joystick.c b/src/joystick/os2/SDL_os2joystick.c index b92c16bbc..5d39df849 100644 --- a/src/joystick/os2/SDL_os2joystick.c +++ b/src/joystick/os2/SDL_os2joystick.c @@ -708,10 +708,18 @@ static int joyGetEnv(struct _joycfg * joydata) while (*joyenv == ' ' && *joyenv != 0) joyenv++; /* jump spaces... */ /* If the string name starts with '... get if fully */ - if (*joyenv == '\'') joyenv += joyGetData(++joyenv,joydata->name,'\'',sizeof(joydata->name)); + if (*joyenv == '\'') { + joyenv++; + joyenv += joyGetData(joyenv,joydata->name,'\'',sizeof(joydata->name)); + } /* If not, get it until the next space */ - else if (*joyenv == '\"') joyenv += joyGetData(++joyenv,joydata->name,'\"',sizeof(joydata->name)); - else joyenv += joyGetData(joyenv,joydata->name,' ',sizeof(joydata->name)); + else if (*joyenv == '\"') { + joyenv++; + joyenv += joyGetData(joyenv,joydata->name,'\"',sizeof(joydata->name)); + } + else { + joyenv += joyGetData(joyenv,joydata->name, ' ',sizeof(joydata->name)); + } /* Now get the number of axes */ while (*joyenv == ' ' && *joyenv != 0) joyenv++; /* jump spaces... */