diff options
author | Haru <haru@dotalux.com> | 2020-05-10 20:35:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-10 20:35:59 +0200 |
commit | 0d66a7243aa6e129cddea4ca09c2616354c23ffa (patch) | |
tree | 56fe416e50f56c2265d72b920efd238538ac22ab /src/char/inter.c | |
parent | 944d8489f1bcca93e6b2ff06a159084f064dce12 (diff) | |
parent | 66f9a2a1bc2fd509d13729ad6bc586a3b7ad2347 (diff) | |
download | hercules-0d66a7243aa6e129cddea4ca09c2616354c23ffa.tar.gz hercules-0d66a7243aa6e129cddea4ca09c2616354c23ffa.tar.bz2 hercules-0d66a7243aa6e129cddea4ca09c2616354c23ffa.tar.xz hercules-0d66a7243aa6e129cddea4ca09c2616354c23ffa.zip |
Merge pull request #2705 from Kenpachi2k13/string_var_size
Cap string variable value length and unify corresponding SQL columns size
Diffstat (limited to 'src/char/inter.c')
-rw-r--r-- | src/char/inter.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/char/inter.c b/src/char/inter.c index 2d8d06a9c..5252b3315 100644 --- a/src/char/inter.c +++ b/src/char/inter.c @@ -676,13 +676,13 @@ static int inter_accreg_fromsql(int account_id, int char_id, int fd, int type) plen += 4; SQL->GetData(inter->sql_handle, 2, &data, NULL); - len = strlen(data)+1; + len = strlen(data); - WFIFOB(fd, plen) = (unsigned char)len;/* won't be higher; the column size is 254 */ + WFIFOB(fd, plen) = (unsigned char)len; // Won't be higher; the column size is 255. plen += 1; - safestrncpy(WFIFOP(fd,plen), data, len); - plen += len; + safestrncpy(WFIFOP(fd, plen), data, len + 1); + plen += len + 1; WFIFOW(fd, 14) += 1; |