diff options
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 73fc387e3..37cd03119 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -2705,14 +2705,15 @@ void read_channels_config(void) { } else { unsigned char d = 0, dlen = strlen(irc_server); char server[40]; - + if (dlen > 39) + dlen = 39; memset(server, '\0', sizeof(server)); for(d = 0; d < dlen; d++) { if(irc_server[d] == ':') { memcpy(server, irc_server, d); safestrncpy(hChSys.irc_server, server, 40); - memcpy(server, &irc_server[d+1], dlen); + memcpy(server, &irc_server[d+1], dlen - d - 1); hChSys.irc_server_port = atoi(server); break; } |