summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKUDr <KUDr@openttd.org>2007-07-04 02:41:39 +0000
committerKUDr <KUDr@openttd.org>2007-07-04 02:41:39 +0000
commit21417ebac7f25eb2fc4e8678d1e7327ec363efec (patch)
tree65a4af0328d272bd646dd4975cc1f3d2041658c9 /src
parentc5a122d642c93c8e21a08ed05527f33bd4b8565d (diff)
downloadopenttd-21417ebac7f25eb2fc4e8678d1e7327ec363efec.tar.xz
(svn r10429) -Fix: VC8 Code Analyzer warning: buffer overrun
Diffstat (limited to 'src')
-rw-r--r--src/rail.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rail.h b/src/rail.h
index 52139b69a..37944cb3d 100644
--- a/src/rail.h
+++ b/src/rail.h
@@ -290,8 +290,8 @@ static inline Track FindFirstTrack(TrackBits tracks)
*/
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;
}
/**