summaryrefslogtreecommitdiffstats
path: root/src/weapons/WeaponInfo.cpp
diff options
context:
space:
mode:
authorerorcun <erorcunerorcun@hotmail.com.tr>2020-12-28 01:25:26 +0100
committererorcun <erorcunerorcun@hotmail.com.tr>2020-12-28 01:25:26 +0100
commitd3f2f4f6ac35d33e67b09ca87fb703a6beca2a7d (patch)
tree0593351cf841aa39c5db3ae5d710920321068252 /src/weapons/WeaponInfo.cpp
parentfix (diff)
downloadre3-d3f2f4f6ac35d33e67b09ca87fb703a6beca2a7d.tar
re3-d3f2f4f6ac35d33e67b09ca87fb703a6beca2a7d.tar.gz
re3-d3f2f4f6ac35d33e67b09ca87fb703a6beca2a7d.tar.bz2
re3-d3f2f4f6ac35d33e67b09ca87fb703a6beca2a7d.tar.lz
re3-d3f2f4f6ac35d33e67b09ca87fb703a6beca2a7d.tar.xz
re3-d3f2f4f6ac35d33e67b09ca87fb703a6beca2a7d.tar.zst
re3-d3f2f4f6ac35d33e67b09ca87fb703a6beca2a7d.zip
Diffstat (limited to 'src/weapons/WeaponInfo.cpp')
-rw-r--r--src/weapons/WeaponInfo.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/weapons/WeaponInfo.cpp b/src/weapons/WeaponInfo.cpp
index 30c6c8cb..acb11a88 100644
--- a/src/weapons/WeaponInfo.cpp
+++ b/src/weapons/WeaponInfo.cpp
@@ -164,10 +164,9 @@ CWeaponInfo::LoadWeaponData(void)
line[linelen] = '\0';
// skip white space
- for (lp = 0; line[lp] <= ' '; lp++);
+ for (lp = 0; line[lp] <= ' ' && line[lp] != '\0'; lp++);
- if (lp >= linelen || // FIX: game uses == here, but this is safer if we have empty lines
- line[lp] == '#')
+ if (line[lp] == '\0' || line[lp] == '#')
continue;
spread = 0.0f;