diff --git a/include/h.h b/include/h.h index 522e6a722..05e466906 100644 --- a/include/h.h +++ b/include/h.h @@ -1029,6 +1029,7 @@ extern NameValuePrioList *find_nvplist(NameValuePrioList *list, char *name); extern void free_nvplist(NameValuePrioList *lst); extern char *get_connect_extinfo(Client *client); extern char *unreal_strftime(char *str); +extern void strtolower_safe(char *dst, char *src, int size); /* src/unrealdb.c start */ extern UnrealDB *unrealdb_open(const char *filename, UnrealDBMode mode, char *secret_block); extern int unrealdb_close(UnrealDB *c); diff --git a/src/modules/antirandom.c b/src/modules/antirandom.c index 176351c59..8522f3681 100644 --- a/src/modules/antirandom.c +++ b/src/modules/antirandom.c @@ -858,20 +858,6 @@ static int internal_getscore(char *str) return score; } -void strtolower_safe(char *dst, char *src, int size) -{ - if (!size) - return; /* size of 0 is unworkable */ - size--; /* for \0 */ - - for (; *src && size; src++) - { - *dst++ = tolower(*src); - size--; - } - *dst = '\0'; -} - /** Returns "spam score". * @note a user is expected, do not call for anything else (eg: servers) */ diff --git a/src/support.c b/src/support.c index a8eb54a76..6207d938a 100644 --- a/src/support.c +++ b/src/support.c @@ -1335,3 +1335,18 @@ char *unreal_strftime(char *str) return str; return buf; } + +/** Convert a string to lowercase */ +void strtolower_safe(char *dst, char *src, int size) +{ + if (!size) + return; /* size of 0 is unworkable */ + size--; /* for \0 */ + + for (; *src && size; src++) + { + *dst++ = tolower(*src); + size--; + } + *dst = '\0'; +}