summaryrefslogtreecommitdiff
path: root/functions.h
diff options
context:
space:
mode:
authorLuke Bratch <luke@bratch.co.uk>2020-10-21 23:56:50 +0100
committerLuke Bratch <luke@bratch.co.uk>2020-10-21 23:56:50 +0100
commit80881f04e70b1708a303ae71774b87301f8deb38 (patch)
tree417b48760bc30491f7a975350feeb4e8414d90f7 /functions.h
parentb09cbe8b3575ec018f7d73a0bcd751dba011fc72 (diff)
Don't have arrindex() return 0 on failure as 0 is a valid index. Instead return -1 and change callers to check this.
Diffstat (limited to 'functions.h')
-rw-r--r--functions.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/functions.h b/functions.h
index 643328f..c22d7ac 100644
--- a/functions.h
+++ b/functions.h
@@ -93,6 +93,7 @@ void updatenickuserhost(char *nickuserhost, char *nick);
void updategreetings(char *greeting001, char *greeting002, char *greeting003, char *greeting004, char *greeting005a, char *greeting005b, char *greeting005c, char *newnickuserhost, char *oldnickuserhost, char *newnick, char *oldnick);
// Return index of requested client FD within the clients array.
+// Returns 0 or more on success, or -1 on failure.
// TODO - Use this wherever we are calculating the position (various places) instead of
// duplicating code.
int arrindex(struct client *clients, int clientfd);