summaryrefslogtreecommitdiff
path: root/src/map/charcommand.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-04-01 21:15:17 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-04-01 21:15:17 +0000
commitb1d22b02963b16c4edcce0cd5d2bc521d97348f9 (patch)
tree086fb6a7f01f7b6f67bf99e7e16c002b2d3890c9 /src/map/charcommand.c
parent20e3875e35b8e4801ef22eb72de8508c0879d518 (diff)
downloadhercules-b1d22b02963b16c4edcce0cd5d2bc521d97348f9.tar.gz
hercules-b1d22b02963b16c4edcce0cd5d2bc521d97348f9.tar.bz2
hercules-b1d22b02963b16c4edcce0cd5d2bc521d97348f9.tar.xz
hercules-b1d22b02963b16c4edcce0cd5d2bc521d97348f9.zip
- Reviewed atcommand.c and charcommand.c to make sure there's no scanf where a string argument is specified without a size limit.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10111 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/charcommand.c')
-rw-r--r--src/map/charcommand.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/map/charcommand.c b/src/map/charcommand.c
index f241148c3..e826d42b8 100644
--- a/src/map/charcommand.c
+++ b/src/map/charcommand.c
@@ -224,7 +224,7 @@ CharCommandType charcommand(struct map_session_data* sd, const int level, const
int i = 0;
memset(info, 0, sizeof(CharCommandInfo));
sscanf(p, "%100s", command);
- command[sizeof(command)-1] = '\0';
+ command[100] = '\0';
while (charcommand_info[i].type != CharCommand_Unknown) {
if (strcmpi(command+1, charcommand_info[i].command+1) == 0 && level >= charcommand_info[i].level) {
@@ -891,16 +891,16 @@ charcommand_effect(const int fd, struct map_session_data* sd,
const char* command, const char* message)
{
struct map_session_data *pl_sd = NULL;
- char target[255];
+ char target[NAME_LENGTH];
int type = 0;
nullpo_retr(-1, sd);
- if (!message || !*message || sscanf(message, "%d %s", &type, target) != 2) {
+ if (!message || !*message || sscanf(message, "%d %23s", &type, target) != 2) {
clif_displaymessage(fd, "usage: #effect <type+> <target>.");
return -1;
}
- if((pl_sd=map_nick2sd((char *) target)) == NULL)
+ if((pl_sd=map_nick2sd(target)) == NULL)
return -1;
clif_specialeffect(&pl_sd->bl, type, AREA);