Mercurial > hg > openttd
changeset 7155:2db6c3a78a30 draft
(svn r10429) -Fix: VC8 Code Analyzer warning: buffer overrun
author | KUDr <KUDr@openttd.org> |
---|---|
date | Wed, 04 Jul 2007 02:41:39 +0000 |
parents | 0fbfd542a99e |
children | 8b6b8579864b |
files | src/rail.h |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/rail.h +++ b/src/rail.h @@ -290,8 +290,8 @@ */ static inline Track TrackBitsToTrack(TrackBits tracks) { - assert(tracks == INVALID_TRACK_BIT || (tracks != TRACK_BIT_NONE && KILL_FIRST_BIT(tracks) == 0)); - return tracks != INVALID_TRACK_BIT ? (Track)FIND_FIRST_BIT(tracks) : INVALID_TRACK; + assert(tracks == INVALID_TRACK_BIT || (tracks != TRACK_BIT_NONE && KILL_FIRST_BIT(tracks & TRACK_BIT_MASK) == 0)); + return tracks != INVALID_TRACK_BIT ? (Track)FIND_FIRST_BIT(tracks & TRACK_BIT_MASK) : INVALID_TRACK; } /**