Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
CONVERT now checks for overflows.
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbens committed Aug 5, 2008
1 parent 4f74e62 commit c9b5798
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/haptic/darwin/SDL_syshaptic.c
Expand Up @@ -576,7 +576,7 @@ SDL_SYS_SetDirection( FFEFFECT * effect, SDL_HapticDirection *dir, int naxes )
}
}

#define CONVERT(x) (((x)*10000) / 0x7FFF)
#define CONVERT(x) (((x) > 0x7FFF) ? 10000 : ((x)*10000) / 0x7FFF)
/*
* Creates the FFEFFECT from a SDL_HapticEffect.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/haptic/win32/SDL_syshaptic.c
Expand Up @@ -575,7 +575,7 @@ SDL_SYS_SetDirection( DIEFFECT * effect, SDL_HapticDirection *dir, int naxes )
}
}

#define CONVERT(x) (((x)*10000) / 0x7FFF)
#define CONVERT(x) (((x) > 0x7FFF) ? 10000 : ((x)*10000) / 0x7FFF)
/*
* Creates the DIEFFECT from a SDL_HapticEffect.
*/
Expand Down

0 comments on commit c9b5798

Please sign in to comment.