From cd4023684f743b44c5be466ff1d3f6e8e24811b9 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Tue, 19 Dec 2023 23:55:18 +0100 Subject: Reformatted parse_command() --- FICS/command.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/FICS/command.c b/FICS/command.c index 53bffaa..c61b75a 100644 --- a/FICS/command.c +++ b/FICS/command.c @@ -92,24 +92,24 @@ PRIVATE int lastCommandFound = -1; int player_notify_departure(int p); /* added for warnings */ -/* Copies command into comm, and returns pointer to parameters in - * parameters +/* + * Copies command into 'comm'. */ -PRIVATE int parse_command(char *com_string, - char **comm, - char **parameters) +PRIVATE int +parse_command(char *com_string, char **comm, char **parameters) { - *comm = com_string; - *parameters = eatword(com_string); - if (**parameters != '\0') { - **parameters = '\0'; - (*parameters)++; - *parameters = eatwhite(*parameters); - } - if (strlen(*comm) >= MAX_COM_LENGTH) { - return COM_BADCOMMAND; - } - return COM_OK; + *comm = com_string; + *parameters = eatword(com_string); + + if (**parameters != '\0') { + **parameters = '\0'; + (*parameters)++; + *parameters = eatwhite(*parameters); + } + + if (strlen(*comm) >= MAX_COM_LENGTH) + return COM_BADCOMMAND; + return COM_OK; } PUBLIC int alias_lookup(char *tmp, alias_type *alias_list, int numalias) -- cgit v1.2.3