summaryrefslogtreecommitdiff
path: root/src/map/charsave.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-27 01:24:34 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-27 01:24:34 +0000
commit3633262bf2d8db0dd3bd51370826120371aac4a0 (patch)
treec5ae0b332226049181786cbbd3d13515d2cd2491 /src/map/charsave.c
parentad74cd5605eb1d0d4e774216dd62b471a9721cbe (diff)
downloadhercules-3633262bf2d8db0dd3bd51370826120371aac4a0.tar.gz
hercules-3633262bf2d8db0dd3bd51370826120371aac4a0.tar.bz2
hercules-3633262bf2d8db0dd3bd51370826120371aac4a0.tar.xz
hercules-3633262bf2d8db0dd3bd51370826120371aac4a0.zip
- Changed status_point/skill_point to unsigned short. Adjusted the code as necessary to prevent overflows.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5762 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/charsave.c')
-rw-r--r--src/map/charsave.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/map/charsave.c b/src/map/charsave.c
index aa066d1e6..4551b2787 100644
--- a/src/map/charsave.c
+++ b/src/map/charsave.c
@@ -74,8 +74,8 @@ struct mmo_charstatus *charsave_loadchar(int charid){
c->hp = atoi(charsql_row[17]);
c->max_sp = atoi(charsql_row[18]);
c->sp = atoi(charsql_row[19]);
- c->status_point = atoi(charsql_row[20]);
- c->skill_point = atoi(charsql_row[21]);
+ c->status_point = atoi(charsql_row[20]) > USHRT_MAX? USHRT_MAX : atoi(charsql_row[20]);
+ c->skill_point = atoi(charsql_row[21]) > USHRT_MAX? USHRT_MAX : atoi(charsql_row[21]);
c->option = atoi(charsql_row[22]);
c->karma = atoi(charsql_row[23]);
c->manner = atoi(charsql_row[24]);