aboutsummaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2023-09-21 16:49:11 +0000
committerrodri <rgl@antares-labs.eu>2023-09-21 16:49:11 +0000
commit497acdd8860d629ba24ed9976fd47eeb743b74ab (patch)
tree7e8db0be276527ccc0b3d173290655653c8cdd64 /util.c
parent33de2d046acfc7ee42fb71b1804b091f671b098a (diff)
downloadbattleship-497acdd8860d629ba24ed9976fd47eeb743b74ab.tar.gz
battleship-497acdd8860d629ba24ed9976fd47eeb743b74ab.tar.bz2
battleship-497acdd8860d629ba24ed9976fd47eeb743b74ab.zip
add parsecmd to the server.
modified it to allow for commands with the same name but different nargs. now each match list entry is preceded by an 'm', to simplify its processing. note that this breaks the client. the next commit will fix that.
Diffstat (limited to 'util.c')
-rw-r--r--util.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/util.c b/util.c
index 325bd3e..cdd1d52 100644
--- a/util.c
+++ b/util.c
@@ -147,3 +147,9 @@ max(int a, int b)
{
return a > b? a: b;
}
+
+int
+min(int a, int b)
+{
+ return a < b? a: b;
+}